widgets module
widgets module.
contains QtWidgets-based classes
__all__ = ['app', 'Application', 'AbstractSlider', 'AbstractSliderMixin', 'AbstractButton', 'AbstractButtonMixin', 'AbstractSpinBox', 'AbstractSpinBoxMixin', 'AbstractScrollArea', 'AbstractScrollAreaMixin', 'AbstractItemView', 'AbstractItemViewMixin', 'MdiSubWindow', 'MdiArea', 'ScrollBar', 'ScrollArea', 'Widget', 'WidgetMixin', 'RubberBand', 'GraphicsTransform', 'GraphicsTransformMixin', 'GraphicsRotation', 'GraphicsScale', 'GraphicsItem', 'GraphicsItemMixin', 'GraphicsItemGroup', 'AbstractGraphicsShapeItem', 'AbstractGraphicsShapeItemMixin', 'GraphicsPixmapItem', 'GraphicsObject', 'GraphicsObjectMixin', 'GraphicsTextItem', 'GraphicsLayoutItem', 'GraphicsLayoutItemMixin', 'GraphicsLayout', 'GraphicsLayoutMixin', 'GraphicsGridLayout', 'GraphicsAnchorLayout', 'GraphicsLinearLayout', 'GraphicsWidget', 'GraphicsWidgetMixin', 'GraphicsProxyWidget', 'GraphicsLineItem', 'GraphicsRectItem', 'GraphicsSimpleTextItem', 'GraphicsPolygonItem', 'GraphicsEllipseItem', 'GraphicsPathItem', 'GraphicsWidget', 'GraphicsEffect', 'GraphicsEffectMixin', 'GraphicsBlurEffect', 'GraphicsDropShadowEffect', 'GraphicsColorizeEffect', 'GraphicsOpacityEffect', 'GraphicsScene', 'GraphicsView', 'GraphicsViewMixin', 'Style', 'StyleMixin', 'CommonStyle', 'CommonStyleMixin', 'ProxyStyle', 'StyleOption', 'StyleOptionMixin', 'StyleOptionComplex', 'StyleOptionComplexMixin', 'SpacerItem', 'SizePolicy', 'StylePainter', 'StyleFactory', 'Dialog', 'DialogMixin', 'MessageBox', 'ErrorMessage', 'FileIconProvider', 'FileSystemModel', 'LayoutItem', 'LayoutItemMixin', 'WidgetItem', 'Layout', 'LayoutMixin', 'FormLayout', 'BoxLayout', 'StackedLayout', 'GridLayout', 'ToolBox', 'Slider', 'Dial', 'StyleOptionButton', 'StyleOptionDockWidget', 'StyleOptionFocusRect', 'StyleOptionGraphicsItem', 'StyleOptionHeader', 'StyleOptionMenuItem', 'StyleOptionProgressBar', 'StyleOptionRubberBand', 'StyleOptionTab', 'StyleOptionTabBarBase', 'StyleOptionTabWidgetFrame', 'StyleOptionToolBar', 'StyleOptionToolBox', 'StyleOptionViewItem', 'StyleOptionComboBox', 'StyleOptionGroupBox', 'StyleOptionSizeGrip', 'StyleOptionSlider', 'StyleOptionSpinBox', 'StyleOptionTitleBar', 'StyleOptionToolButton', 'StyleOptionFrame', 'Frame', 'FrameMixin', 'FocusFrame', 'ListWidgetItem', 'TreeWidgetItem', 'TreeWidgetItemIterator', 'Action', 'ActionMixin', 'ActionGroup', 'WidgetAction', 'ToolButton', 'ToolTip', 'Menu', 'MenuBar', 'StatusBar', 'TabWidget', 'TabBar', 'ToolBar', 'HeaderView', 'DockWidget', 'Label', 'PushButton', 'PushButtonMixin', 'CommandLinkButton', 'RadioButton', 'ComboBox', 'ComboBoxMixin', 'FontComboBox', 'SpinBox', 'DoubleSpinBox', 'CheckBox', 'LineEdit', 'KeySequenceEdit', 'TextEdit', 'TextEditMixin', 'DateEdit', 'TimeEdit', 'DateTimeEdit', 'DateTimeEditMixin', 'CalendarWidget', 'PlainTextEdit', 'PlainTextEditMixin', 'TextBrowser', 'Completer', 'ProgressBar', 'LCDNumber', 'ColumnView', 'ListView', 'ListViewMixin', 'ListWidget', 'TreeView', 'TreeViewMixin', 'TreeWidget', 'TableWidgetSelectionRange', 'ScrollerProperties', 'Scroller', 'TableView', 'TableViewMixin', 'TableWidgetItem', 'TableWidget', 'SplashScreen', 'ProgressDialog', 'FontDialog', 'FileDialog', 'ColorDialog', 'InputDialog', 'DialogButtonBox', 'ButtonGroup', 'GroupBox', 'SplitterHandle', 'Splitter', 'Wizard', 'WizardPage', 'StackedWidget', 'MainWindow', 'Shortcut', 'WhatsThis', 'AbstractItemDelegate', 'AbstractItemDelegateMixin', 'ItemDelegate', 'StyledItemDelegate', 'SystemTrayIcon', 'UndoView', 'DataWidgetMapper', 'SizeGrip', 'KeyEventTransition', 'MouseEventTransition', 'GraphicsSceneHoverEvent', 'GraphicsSceneMouseEvent', 'GraphicsSceneWheelEvent', 'GraphicsSceneContextMenuEvent', 'GraphicsSceneDragDropEvent', 'GraphicsSceneHelpEvent', 'GraphicsSceneMoveEvent', 'GraphicsSceneResizeEvent', 'GraphicsSceneEvent', 'GestureEvent', 'PlainTextDocumentLayout', 'Gesture', 'GestureMixin', 'TapGesture', 'TapAndHoldGesture', 'PanGesture', 'PinchGesture', 'SwipeGesture', 'ItemEditorFactory', 'ItemEditorCreatorBase']
module-attribute
AbstractButton
Bases: AbstractButtonMixin, QtWidgets.QAbstractButton
AbstractButtonMixin
Bases: widgets.WidgetMixin
Source code in prettyqt\widgets\abstractbutton.py
is_on: bool
writable
property
__bool__()
get_icon() -> gui.Icon | None
get_icon_size() -> core.Size
get_shortcut() -> gui.KeySequence
get_value() -> bool
set_icon(icon: datatypes.IconType)
Set the icon for the button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon |
datatypes.IconType
|
icon to use |
required |
set_icon_size(size: int | datatypes.SizeType)
Set size of the icon.
set_shortcut(shortcut: None | QtGui.QKeySequence | str)
Source code in prettyqt\widgets\abstractbutton.py
set_style_icon(icon: widgets.style.StandardPixmapStr, size: int = 15)
Set theme icon for the button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon |
widgets.style.StandardPixmapStr
|
icon to use |
required |
size |
int
|
icon size |
15
|
Source code in prettyqt\widgets\abstractbutton.py
set_text(text: str)
AbstractGraphicsShapeItem
Bases: AbstractGraphicsShapeItemMixin, QtWidgets.QAbstractGraphicsShapeItem
AbstractGraphicsShapeItemMixin
Bases: widgets.GraphicsItemMixin
AbstractItemDelegate
Bases: AbstractItemDelegateMixin, QtWidgets.QAbstractItemDelegate
AbstractItemDelegateMixin
Bases: core.ObjectMixin
AbstractItemView
Bases: AbstractItemViewMixin, QtWidgets.QAbstractItemView
AbstractItemViewMixin
Bases: widgets.AbstractScrollAreaMixin
Source code in prettyqt\widgets\abstractitemview.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | |
model_changed = core.Signal(QtCore.QAbstractItemModel)
class-attribute
__len__() -> int
current_column() -> int | None
current_data()
current_index() -> QtCore.QModelIndex | None
current_row() -> int | None
get_drag_drop_mode() -> DragDropModeStr
Return current drag-drop mode.
Returns:
| Type | Description |
|---|---|
DragDropModeStr
|
drag-drop mode |
get_edit_triggers() -> list[EditTriggerStr]
get_horizontal_scroll_mode() -> ScrollModeStr
Return current horizontal scroll mode.
Returns:
| Type | Description |
|---|---|
ScrollModeStr
|
horizontal scroll mode |
get_selection_behaviour() -> SelectionBehaviourStr
Return current selection behaviour.
Returns:
| Type | Description |
|---|---|
SelectionBehaviourStr
|
selection behaviour |
get_selection_mode() -> SelectionModeStr
Return current selection mode.
Returns:
| Type | Description |
|---|---|
SelectionModeStr
|
selection mode |
get_vertical_scroll_mode() -> ScrollModeStr
Return current vertical scroll mode.
Returns:
| Type | Description |
|---|---|
ScrollModeStr
|
vertical scroll mode |
highlight_when_inactive()
jump_to_column(col_num: int)
Make sure column at given index is visible.
scrolls to column at given index
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col_num |
int
|
column to scroll to |
required |
Source code in prettyqt\widgets\abstractitemview.py
num_selected() -> int
Return amount of selected rows.
Returns:
| Type | Description |
|---|---|
int
|
amount of selected rows |
scroll_to(index, mode: ScrollHintStr = 'ensure_visible')
scroll_to_bottom()
scroll_to_top()
selectAll()
Override, we dont want to selectAll for too many items bc of performance.
Source code in prettyqt\widgets\abstractitemview.py
select_last_row()
selected_data() -> Generator[Any, None, None]
Return generator yielding selected userData.
selected_indexes() -> list[QtCore.QModelIndex]
Return list of selected indexes in first row.
Source code in prettyqt\widgets\abstractitemview.py
selected_names() -> Generator[Any, None, None]
selected_rows() -> Generator[int, None, None]
set_delegate(delegate: QtWidgets.QAbstractItemDelegate, column: int | None = None, row: int | None = None, persistent: bool = False)
Source code in prettyqt\widgets\abstractitemview.py
set_drag_drop_mode(mode: DragDropModeStr)
Set drag-drop mode for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
DragDropModeStr
|
drag-drop mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\abstractitemview.py
set_edit_triggers(*triggers: EditTriggerStr | None)
Source code in prettyqt\widgets\abstractitemview.py
set_horizontal_scroll_mode(mode: ScrollModeStr)
Set the horizontal scroll mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ScrollModeStr
|
mode to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid scroll mode |
Source code in prettyqt\widgets\abstractitemview.py
set_icon_size(size: int | datatypes.SizeType)
set_model(model: QtCore.QAbstractItemModel | None)
Delete old selection model explicitely, seems to help with memory usage.
Source code in prettyqt\widgets\abstractitemview.py
set_scroll_mode(mode: ScrollModeStr)
Set the scroll mode for both directions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ScrollModeStr
|
mode to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid scroll mode |
Source code in prettyqt\widgets\abstractitemview.py
set_selection_behaviour(behaviour: SelectionBehaviourStr)
Set selection behaviour for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
behaviour |
SelectionBehaviourStr
|
selection behaviour to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
behaviour does not exist |
Source code in prettyqt\widgets\abstractitemview.py
set_selection_mode(mode: SelectionModeStr | None)
Set selection mode for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
SelectionModeStr | None
|
selection mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\abstractitemview.py
set_table_color(color: str)
set_vertical_scroll_mode(mode: ScrollModeStr)
Set the vertical scroll mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ScrollModeStr
|
mode to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid scroll mode |
Source code in prettyqt\widgets\abstractitemview.py
setup_dragdrop_move()
toggle_select_all()
Select all items from list (deselect when all selected).
Source code in prettyqt\widgets\abstractitemview.py
AbstractScrollArea
Bases: AbstractScrollAreaMixin, QtWidgets.QAbstractScrollArea
AbstractScrollAreaMixin
Bases: widgets.FrameMixin
Source code in prettyqt\widgets\abstractscrollarea.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
h_scrollbar
writable
property
v_scrollbar
writable
property
__init__(*args, **kwargs)
get_horizontal_scrollbar_policy()
get_size_adjust_policy() -> SizePolicyStr
Return size adjust policy.
Returns:
| Type | Description |
|---|---|
SizePolicyStr
|
size adjust policy |
get_vertical_scrollbar_policy()
scroll_to_bottom()
scroll_to_top()
set_horizontal_scrollbar_policy(mode: constants.ScrollBarPolicyStr)
Set the horizontal scrollbar visibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
constants.ScrollBarPolicyStr
|
visibilty to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid scrollbar policy |
Source code in prettyqt\widgets\abstractscrollarea.py
set_horizontal_scrollbar_width(width: int)
Set the horizontal scrollbar width.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width |
int
|
width in pixels |
required |
Source code in prettyqt\widgets\abstractscrollarea.py
set_scrollbar_policy(mode: constants.ScrollBarPolicyStr)
Set the policy for both scrollbars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
constants.ScrollBarPolicyStr
|
visibilty to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid scrollbar policy |
Source code in prettyqt\widgets\abstractscrollarea.py
set_scrollbar_width(width: int)
Set the width for both scrollbars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width |
int
|
width in pixels |
required |
set_size_adjust_policy(policy: SizePolicyStr)
Set size adjust policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
SizePolicyStr
|
size adjust policy to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid size adjust policy |
Source code in prettyqt\widgets\abstractscrollarea.py
set_vertical_scrollbar_policy(mode: constants.ScrollBarPolicyStr)
Set the vertical scrollbar visibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
constants.ScrollBarPolicyStr
|
visibilty to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid scrollbar policy |
Source code in prettyqt\widgets\abstractscrollarea.py
set_vertical_scrollbar_width(width: int)
Set the vertical scrollbar width.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width |
int
|
width in pixels |
required |
Source code in prettyqt\widgets\abstractscrollarea.py
AbstractSlider
Bases: AbstractSliderMixin, QtWidgets.QAbstractSlider
AbstractSliderMixin
Bases: widgets.WidgetMixin
Source code in prettyqt\widgets\abstractslider.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
value_changed = core.Signal(int)
class-attribute
get_orientation() -> constants.OrientationStr
get_repeat_action() -> SliderActionStr
Get current repeat action.
Returns:
| Type | Description |
|---|---|
SliderActionStr
|
current repeat action |
get_value()
is_horizontal() -> bool
Check if silder is horizontal.
Returns:
| Type | Description |
|---|---|
bool
|
True if horizontal, else False |
is_vertical() -> bool
Check if silder is vertical.
Returns:
| Type | Description |
|---|---|
bool
|
True if vertical, else False |
on_scrollbar_range_changed(minval, maxval)
on_value_change()
scroll_to_max()
scroll_to_min()
set_auto_scroll_to_end(scroll: bool = True)
Set to always scroll to the end when range changes.
Source code in prettyqt\widgets\abstractslider.py
set_horizontal()
set_orientation(orientation: constants.OrientationStr)
Set the orientation of the slider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation |
constants.OrientationStr
|
orientation for the slider |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
orientation does not exist |
Source code in prettyqt\widgets\abstractslider.py
set_range(min_val: int, max_val: int)
set_repeat_action(action: SliderActionStr, threshold: int = 500, repeat_time: int = 50)
Set the repeat action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action |
SliderActionStr
|
repeat action |
required |
threshold |
int
|
initial delay in ms |
500
|
repeat_time |
int
|
repeat time in ms |
50
|
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid repeat action |
Source code in prettyqt\widgets\abstractslider.py
set_step_size(step_size: int)
set_value(value: int)
set_vertical()
trigger_action(action: SliderActionStr)
AbstractSpinBox
Bases: AbstractSpinBoxMixin, QtWidgets.QAbstractSpinBox
AbstractSpinBoxMixin
Bases: widgets.WidgetMixin
Source code in prettyqt\widgets\abstractspinbox.py
__init__(*args, **kwargs)
get_button_symbols() -> SymbolStr
Return button symbol type.
Returns:
| Type | Description |
|---|---|
SymbolStr
|
button symbol type |
get_correction_mode() -> CorrectionModeStr
Return correction mode.
Returns:
| Type | Description |
|---|---|
CorrectionModeStr
|
correction mode |
get_step_type() -> StepTypeStr
get_value() -> int
is_valid() -> bool
set_button_symbols(mode: SymbolStr)
Set button symbol type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
SymbolStr
|
button symbol type to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid button symbol type |
Source code in prettyqt\widgets\abstractspinbox.py
set_correction_mode(mode: CorrectionModeStr)
Set correction mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
CorrectionModeStr
|
correction mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid correction mode |
Source code in prettyqt\widgets\abstractspinbox.py
set_special_value(value: str)
set_step_type(mode: StepTypeStr)
Set step type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
StepTypeStr
|
step type to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid step type |
Source code in prettyqt\widgets\abstractspinbox.py
set_validator(validator: gui.Validator)
Action
Bases: ActionMixin, prettyprinter.PrettyPrinter, QtWidgets.QAction
ActionGroup
Bases: core.ObjectMixin, QtWidgets.QActionGroup
Source code in prettyqt\widgets\actiongroup.py
__getitem__(item: int) -> QtWidgets.QAction
__init__(parent: QtCore.QObject | None = None)
__len__() -> int
get_exclusion_policy() -> ExclusionPolicyStr
Return current exclusion policy.
Returns:
| Type | Description |
|---|---|
ExclusionPolicyStr
|
exclusion policy |
set_exclusion_policy(policy: ExclusionPolicyStr | None)
Set exclusion policy to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
ExclusionPolicyStr | None
|
exclusion policy to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
exclusion policy does not exist |
Source code in prettyqt\widgets\actiongroup.py
ActionMixin
Bases: core.ObjectMixin
Source code in prettyqt\widgets\action.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
__init__(parent: QtCore.QObject | None = None, text: str = '', icon: datatypes.IconType = None, shortcut: str | None = None, tooltip: str = '', checkable: bool = False, checked: bool = False, statustip: str = '', enabled: bool = True, callback: Callable | None = None)
Source code in prettyqt\widgets\action.py
__repr__() -> str
get_font() -> gui.Font
get_icon() -> gui.Icon | None
get_menu_role() -> RoleStr
get_priority() -> PriorityStr
get_shortcut() -> gui.KeySequence | None
get_shortcut_context() -> constants.ContextStr
set_checkable(value: bool)
set_checked(value: bool)
set_disabled()
set_enabled(enabled: bool = True)
set_icon(icon: datatypes.IconType)
Set the icon for the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon |
datatypes.IconType
|
icon to use |
required |
set_menu(menu)
set_menu_role(role: RoleStr)
Set menu role.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role |
RoleStr
|
menu role |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
menu role does not exist |
Source code in prettyqt\widgets\action.py
set_priority(priority: PriorityStr)
Set priority of the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority |
PriorityStr
|
priority for the action |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
priority does not exist |
Source code in prettyqt\widgets\action.py
set_shortcut(shortcut: None | QtGui.QKeySequence | str)
Source code in prettyqt\widgets\action.py
set_shortcut_context(context: constants.ContextStr)
Set shortcut context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context |
constants.ContextStr
|
shortcut context |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
shortcut context does not exist |
Source code in prettyqt\widgets\action.py
set_statustip(text: str)
set_text(text: str)
set_tooltip(tooltip: str | datatypes.PathType, size: datatypes.SizeType | None = None)
Source code in prettyqt\widgets\action.py
Application
BoxLayout
ButtonGroup
Bases: core.ObjectMixin, QtWidgets.QButtonGroup
Source code in prettyqt\widgets\buttongroup.py
__getitem__(index: int) -> QtWidgets.QAbstractButton
CalendarWidget
Bases: widgets.WidgetMixin, QtWidgets.QCalendarWidget
Source code in prettyqt\widgets\calendarwidget.py
get_date() -> datetime.date
get_selection_mode() -> SelectionModeStr
Return current selection mode.
Returns:
| Type | Description |
|---|---|
SelectionModeStr
|
selection mode |
get_value() -> datetime.date
set_range(lower: datatypes.DateType, upper: datatypes.DateType)
Source code in prettyqt\widgets\calendarwidget.py
set_selection_mode(mode: SelectionModeStr | None)
Set selection mode for given calendar widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
SelectionModeStr | None
|
selection mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\calendarwidget.py
CheckBox
Bases: widgets.AbstractButtonMixin, QtWidgets.QCheckBox
Source code in prettyqt\widgets\checkbox.py
value_changed = core.Signal(int)
class-attribute
__init__(label: str = '', parent: QtWidgets.QWidget | None = None, checked: bool = False)
get_checkstate() -> constants.StateStr
ColorDialog
Bases: widgets.DialogMixin, QtWidgets.QColorDialog
Source code in prettyqt\widgets\colordialog.py
current_color() -> gui.Color
get_color(preset: datatypes.ColorType = None, allow_alpha: bool = False, parent: QtWidgets.QWidget | None = None) -> gui.Color
classmethod
Source code in prettyqt\widgets\colordialog.py
get_qcolorshower() -> QtWidgets.QWidget
get_qcolorshowlabel() -> QtWidgets.QFrame
hide_buttons(value: bool = True)
replace_qcolorshowlabel(widget: QtWidgets.QWidget)
Source code in prettyqt\widgets\colordialog.py
use_alpha_channel(value: bool = True)
ColumnView
Bases: widgets.AbstractItemViewMixin, QtWidgets.QColumnView
ComboBox
Bases: ComboBoxMixin, QtWidgets.QComboBox
ComboBoxMixin
Bases: widgets.WidgetMixin
Source code in prettyqt\widgets\combobox.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
value_changed = core.Signal(object)
class-attribute
__init__(*args, **kwargs)
__len__() -> int
add(label: str, data = NoData, icon: datatypes.IconType = None)
Source code in prettyqt\widgets\combobox.py
add_items(items: Iterable | Mapping, default = NoData)
Source code in prettyqt\widgets\combobox.py
get_icon_size() -> core.Size
get_insert_policy() -> InsertPolicyStr
get_size_adjust_policy() -> SizeAdjustPolicyStr
Return size adjust policy.
Returns:
| Type | Description |
|---|---|
SizeAdjustPolicyStr
|
size adjust policy |
get_value() -> Any
hide_completer()
index_changed(index: int)
item_icon(index: int) -> gui.Icon | None
set_data(data: Any)
set_editable(editable: bool)
set_icon_size(size: int | datatypes.SizeType)
Set size of the icons.
set_insert_policy(policy: InsertPolicyStr)
Set insert policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
InsertPolicyStr
|
insert policy to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid insert policy |
Source code in prettyqt\widgets\combobox.py
set_min_char_length(chars: int)
set_size_adjust_policy(policy: SizeAdjustPolicyStr)
Set size adjust policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
SizeAdjustPolicyStr
|
size adjust policy to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid size adjust policy |
Source code in prettyqt\widgets\combobox.py
set_text(text: str)
set_value(value: Any)
CommandLinkButton
Bases: widgets.PushButtonMixin, QtWidgets.QCommandLinkButton
Source code in prettyqt\widgets\commandlinkbutton.py
value_changed = core.Signal(bool)
class-attribute
CommonStyle
Bases: CommonStyleMixin, QtWidgets.QCommonStyle
CommonStyleMixin
Bases: widgets.StyleMixin
Completer
Bases: core.ObjectMixin, QtWidgets.QCompleter
Source code in prettyqt\widgets\completer.py
__init__(parent: QtWidgets.QWidget | None = None)
get_completion_mode() -> CompletionModeStr
Return current completion mode.
Returns:
| Type | Description |
|---|---|
CompletionModeStr
|
completion mode |
get_filter_mode() -> constants.FilterModeStr
get_sort_mode() -> SortModeStr
is_case_sensitive() -> bool
set_case_sensitive(state: bool)
Set case sensitivity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
bool
|
case sensitive |
required |
Source code in prettyqt\widgets\completer.py
set_completion_mode(mode: CompletionModeStr)
Set completion mode to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
CompletionModeStr
|
completion mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
completion mode does not exist |
Source code in prettyqt\widgets\completer.py
set_filter_mode(mode: constants.FilterModeStr)
Set filter mode to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
constants.FilterModeStr
|
filter mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
filter mode does not exist |
Source code in prettyqt\widgets\completer.py
set_sort_mode(mode: SortModeStr | None)
Set sort mode to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
SortModeStr | None
|
sort mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
sort mode does not exist |
Source code in prettyqt\widgets\completer.py
DataWidgetMapper
Bases: core.ObjectMixin, QtWidgets.QDataWidgetMapper
Source code in prettyqt\widgets\datawidgetmapper.py
add_mapping(widget: QtWidgets.QWidget, section: int, property_name: str | None = None)
Source code in prettyqt\widgets\datawidgetmapper.py
get_mapped_property_name(widget: QtWidgets.QWidget) -> str
get_orientation() -> constants.OrientationStr
get_submit_policy() -> SubmitPolicyStr
Return current submit policy.
Returns:
| Type | Description |
|---|---|
SubmitPolicyStr
|
submit policy |
set_orientation(orientation: constants.OrientationStr)
Set the orientation of the data widget mapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation |
constants.OrientationStr
|
orientation for the data widget mapper |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
orientation does not exist |
Source code in prettyqt\widgets\datawidgetmapper.py
set_submit_policy(policy: SubmitPolicyStr)
Set the submit policy of the mapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
SubmitPolicyStr
|
submit_policy for the data widget mapper |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
submit_policy does not exist |
Source code in prettyqt\widgets\datawidgetmapper.py
DateEdit
Bases: widgets.DateTimeEditMixin, QtWidgets.QDateEdit
Source code in prettyqt\widgets\dateedit.py
value_changed = core.Signal(datetime.datetime)
class-attribute
get_value() -> datetime.date
set_range(lower: datatypes.DateType, upper: datatypes.DateType)
Source code in prettyqt\widgets\dateedit.py
DateTimeEdit
Bases: DateTimeEditMixin, QtWidgets.QDateTimeEdit
DateTimeEditMixin
Bases: widgets.AbstractSpinBoxMixin
Source code in prettyqt\widgets\datetimeedit.py
value_changed = core.Signal(datetime.datetime)
class-attribute
__init__(*args, **kwargs)
datetime_changed(date)
get_current_section() -> SectionsStr
get_date() -> datetime.date
get_datetime() -> datetime.datetime
get_displayed_sections() -> list[SectionsStr]
get_section_text(section: SectionsStr) -> str
get_time() -> datetime.time
get_value() -> datetime.datetime
max_date() -> datetime.date
max_datetime() -> datetime.datetime
max_time() -> datetime.time
min_date() -> datetime.date
min_datetime() -> datetime.datetime
min_time() -> datetime.time
set_current_section(section: SectionsStr)
set_format(fmt: str)
set_range(lower: datatypes.DateTimeType, upper: datatypes.DateTimeType)
Source code in prettyqt\widgets\datetimeedit.py
Dial
Bases: widgets.AbstractSliderMixin, QtWidgets.QDial
Source code in prettyqt\widgets\dial.py
Dialog
Bases: DialogMixin, QtWidgets.QDialog
DialogButtonBox
Bases: widgets.WidgetMixin, QtWidgets.QDialogButtonBox
Source code in prettyqt\widgets\dialogbuttonbox.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
button_clicked = core.Signal(str)
class-attribute
__contains__(index: ButtonStr)
__getitem__(index: ButtonStr) -> QtWidgets.QPushButton
__init__(*args, **kwargs)
__iter__() -> Iterator[QtWidgets.QAbstractButton]
__len__() -> int
add_button(button: QtWidgets.QPushButton | ButtonStr, role: RoleStr = 'accept', callback: Callable | None = None) -> widgets.PushButton
Add a button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button |
QtWidgets.QPushButton | ButtonStr
|
button to add |
required |
role |
RoleStr
|
role of the button |
'accept'
|
callback |
Callable | None
|
function to call when button gets clicked |
None
|
Returns:
| Type | Description |
|---|---|
widgets.PushButton
|
created button |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
Button type not available |
Source code in prettyqt\widgets\dialogbuttonbox.py
add_default_button(button: ButtonStr, callback: Callable | None = None) -> QtWidgets.QPushButton
Add a default button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button |
ButtonStr
|
button to add |
required |
callback |
Callable | None
|
function to call when button gets clicked |
None
|
Returns:
| Type | Description |
|---|---|
QtWidgets.QPushButton
|
created button |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
Button type not available |
Source code in prettyqt\widgets\dialogbuttonbox.py
add_default_buttons(buttons: Sequence[ButtonStr])
create(**kwargs)
classmethod
get_orientation() -> constants.OrientationStr
on_click(button: QtCore.QObject)
set_horizontal()
set_orientation(orientation: constants.OrientationStr)
Set the orientation of the button box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation |
constants.OrientationStr
|
orientation for the button box |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
orientation does not exist |
Source code in prettyqt\widgets\dialogbuttonbox.py
DialogMixin
Bases: widgets.WidgetMixin
Source code in prettyqt\widgets\dialog.py
__getitem__(index: str) -> QtWidgets.QWidget
__init__(title: str = '', icon: datatypes.IconType = None, parent: QtWidgets.QWidget | None = None, delete_on_close: bool = False, layout: None | str | QtWidgets.QLayout = None)
Source code in prettyqt\widgets\dialog.py
add_buttonbox() -> widgets.DialogButtonBox
add_widget(widget: QtWidgets.QWidget) -> QtWidgets.QWidget
delete_on_close()
is_accepted() -> bool
keyPressEvent(e)
Source code in prettyqt\widgets\dialog.py
main_loop() -> int
serialize_fields()
DockWidget
Bases: widgets.WidgetMixin, QtWidgets.QDockWidget
Customized DockWidget class.
Contains a custom TitleBar with maximize button
Source code in prettyqt\widgets\dockwidget.py
__init__(*args, **kwargs)
maximise()
maximize()
set_allowed_areas(area: constants.DockPositionsStr)
set_widget(widget: QtWidgets.QWidget)
setup_title_bar()
Source code in prettyqt\widgets\dockwidget.py
DoubleSpinBox
Bases: widgets.AbstractSpinBoxMixin, QtWidgets.QDoubleSpinBox
Source code in prettyqt\widgets\doublespinbox.py
value_changed = core.Signal(float)
class-attribute
__init__(parent: QtWidgets.QWidget | None = None, min_value: float | None = None, max_value: float | None = None, default_value: float | None = None)
Source code in prettyqt\widgets\doublespinbox.py
ErrorMessage
Bases: widgets.DialogMixin, QtWidgets.QErrorMessage
FileDialog
Bases: widgets.DialogMixin, QtWidgets.QFileDialog
Simple dialog used to display some widget.
Source code in prettyqt\widgets\filedialog.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
path_id = path_id
instance-attribute
__init__(path: None | datatypes.PathType = None, mode: AcceptModeStr = 'open', caption: str | None = None, path_id: str | None = None, extension_filter: dict | None = None, file_mode: FileModeStr = 'existing_files', parent: QtWidgets.QWidget | None = None)
Source code in prettyqt\widgets\filedialog.py
choose() -> list[pathlib.Path] | None
Source code in prettyqt\widgets\filedialog.py
choose_folder() -> list[pathlib.Path] | None
get_accept_mode() -> AcceptModeStr
get_directory() -> pathlib.Path
Return current directory.
returns current directory level as a Pathlib object
Returns:
| Type | Description |
|---|---|
pathlib.Path
|
Pathlib object |
get_file_mode() -> FileModeStr
get_filter() -> list[core.dir.FilterStr]
get_label_text(label: LabelStr) -> str
get_view_mode() -> ViewModeStr
open_file() -> list[pathlib.Path] | None
selected_file() -> pathlib.Path | None
selected_files() -> list[pathlib.Path]
set_accept_mode(mode: AcceptModeStr)
Set accept mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
AcceptModeStr
|
accept mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid accept mode |
Source code in prettyqt\widgets\filedialog.py
set_directory(path: datatypes.PathType)
set_extension_filter(extension_dict: dict[str, list[str]])
Set filter based on given dictionary.
dict must contain "'name': ['.ext1', '.ext2']" as key-value pairs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extension_dict |
dict[str, list[str]]
|
filter dictionary |
required |
Source code in prettyqt\widgets\filedialog.py
set_file_mode(mode: FileModeStr)
Set the file mode of the dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
FileModeStr
|
mode to use |
required |
set_filter(*filters: core.dir.FilterStr)
set_label_text(label: LabelStr, text: str)
Set the label text for button label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label |
LabelStr
|
button to set text for |
required |
text |
str
|
text to use |
required |
Source code in prettyqt\widgets\filedialog.py
set_view_mode(mode: ViewModeStr)
Set view mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ViewModeStr
|
view mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid view mode |
Source code in prettyqt\widgets\filedialog.py
FileIconProvider
Bases: gui.AbstractFileIconProviderMixin, QtWidgets.QFileIconProvider
Source code in prettyqt\widgets\fileiconprovider.py
get_icon(typ: gui.abstractfileiconprovider.IconTypeStr | QtCore.QFileInfo | datatypes.PathType) -> QtGui.QIcon
Source code in prettyqt\widgets\fileiconprovider.py
FileSystemModel
FocusFrame
Bases: widgets.WidgetMixin, QtWidgets.QFocusFrame
FontComboBox
Bases: widgets.ComboBoxMixin, QtWidgets.QFontComboBox
Source code in prettyqt\widgets\fontcombobox.py
value_changed = core.Signal(object)
class-attribute
__init__(*args, **kwargs)
get_current_font() -> gui.Font
get_font_filters() -> list[FontFilterStr]
Return list of font filters.
Returns:
| Type | Description |
|---|---|
list[FontFilterStr]
|
font filter list |
get_value() -> gui.Font
set_font_filters(*filters: FontFilterStr)
Set font filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filters |
FontFilterStr
|
font filters to use |
()
|
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid font filters |
Source code in prettyqt\widgets\fontcombobox.py
FontDialog
Bases: widgets.DialogMixin, QtWidgets.QFontDialog
Source code in prettyqt\widgets\fontdialog.py
FormLayout
Bases: widgets.LayoutMixin, QtWidgets.QFormLayout
Source code in prettyqt\widgets\formlayout.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
__add__(other: QtWidgets.QWidget | QtWidgets.QLayout | tuple)
__delitem__(index: int)
__init__(*args, **kwargs)
__iter__() -> Iterator[QtWidgets.QWidget | QtWidgets.QLayout]
__len__() -> int
__setitem__(index: int | tuple[int, RoleStr], value: str | QtWidgets.QWidget)
add(*items)
get_field_growth_policy() -> FieldGrowthPolicyStr
Return current field growth policy.
Returns:
| Type | Description |
|---|---|
FieldGrowthPolicyStr
|
field growth policy |
get_item_position(index: int) -> tuple[int, RoleStr] | None
get_row_wrap_policy() -> RowWrapPolicyStr
Return current row wrap policy.
Returns:
| Type | Description |
|---|---|
RowWrapPolicyStr
|
row wrap policy |
get_widget(row: int, role: RoleStr = 'both') -> QtWidgets.QLayout | QtWidgets.QWidget
set_field_growth_policy(policy: FieldGrowthPolicyStr)
Set field growth policy to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
FieldGrowthPolicyStr
|
field growth policy to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
field growth policy does not exist |
Source code in prettyqt\widgets\formlayout.py
set_row_wrap_policy(policy: RowWrapPolicyStr)
Set row wrap policy to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
RowWrapPolicyStr
|
row wrap policy to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
row wrap policy does not exist |
Source code in prettyqt\widgets\formlayout.py
set_widget(widget: str | QtWidgets.QWidget, row: int, role: RoleStr = 'both')
Frame
Bases: FrameMixin, QtWidgets.QFrame
FrameMixin
Bases: widgets.WidgetMixin
Source code in prettyqt\widgets\frame.py
get_frame_shadow() -> ShadowStr | None
Return current frame shadow.
Returns:
| Type | Description |
|---|---|
ShadowStr | None
|
frame style |
get_frame_shape() -> FrameShapeStr
set_frame_shadow(style: ShadowStr)
Set frame shadow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style |
ShadowStr
|
frame style to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
style does not exist |
Source code in prettyqt\widgets\frame.py
set_frame_shape(shape: FrameShapeStr)
Set frame shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape |
FrameShapeStr
|
frame shape to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
shape does not exist |
Source code in prettyqt\widgets\frame.py
Gesture
Bases: GestureMixin, QtWidgets.QGesture
GestureMixin
Bases: core.ObjectMixin
Source code in prettyqt\widgets\gesture.py
get_gesture_cancel_policy() -> GestureCancelPolicyStr
Return current gesture cancel policy.
Returns:
| Type | Description |
|---|---|
GestureCancelPolicyStr
|
gesture cancel policy |
get_gesture_type() -> constants.GestureTypeStr
get_hot_spot() -> core.PointF
get_state() -> constants.GestureStateStr
set_gesture_cancel_policy(policy: GestureCancelPolicyStr)
Set gesture cancel policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
GestureCancelPolicyStr
|
gesture cancel policy to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
gesture cancel policy does not exist |
Source code in prettyqt\widgets\gesture.py
GraphicsAnchorLayout
Bases: widgets.GraphicsLayoutMixin, QtWidgets.QGraphicsAnchorLayout
Source code in prettyqt\widgets\graphicsanchorlayout.py
add_anchor(first_item: QtWidgets.QGraphicsLayoutItem, first_edge: constants.AnchorPointStr, second_item: QtWidgets.QGraphicsLayoutItem, second_edge: constants.AnchorPointStr) -> QtWidgets.QGraphicsAnchor
Source code in prettyqt\widgets\graphicsanchorlayout.py
add_anchors(first_item: QtWidgets.QGraphicsLayoutItem, second_item: QtWidgets.QGraphicsLayoutItem, orientation: constants.OrientationStr)
Source code in prettyqt\widgets\graphicsanchorlayout.py
add_corner_anchors(first_item: QtWidgets.QGraphicsLayoutItem, first_corner: constants.CornerStr, second_item: QtWidgets.QGraphicsLayoutItem, second_corner: constants.CornerStr)
Source code in prettyqt\widgets\graphicsanchorlayout.py
get_anchor(first_item: QtWidgets.QGraphicsLayoutItem, first_edge: constants.AnchorPointStr, second_item: QtWidgets.QGraphicsLayoutItem, second_edge: constants.AnchorPointStr) -> QtWidgets.QGraphicsAnchor
Source code in prettyqt\widgets\graphicsanchorlayout.py
GraphicsBlurEffect
Bases: widgets.GraphicsEffectMixin, QtWidgets.QGraphicsBlurEffect
Source code in prettyqt\widgets\graphicsblureffect.py
get_blur_hints() -> list[BlurHintStr]
set_blur_hints(*hints: BlurHintStr)
Source code in prettyqt\widgets\graphicsblureffect.py
GraphicsColorizeEffect
Bases: widgets.GraphicsEffectMixin, QtWidgets.QGraphicsColorizeEffect
Source code in prettyqt\widgets\graphicscolorizeeffect.py
__setstate__(state)
GraphicsDropShadowEffect
Bases: widgets.GraphicsEffectMixin, QtWidgets.QGraphicsDropShadowEffect
Source code in prettyqt\widgets\graphicsdropshadoweffect.py
GraphicsEffect
Bases: GraphicsEffectMixin, QtWidgets.QGraphicsEffect
GraphicsEffectMixin
Bases: core.ObjectMixin
GraphicsEllipseItem
Bases: widgets.AbstractGraphicsShapeItemMixin, QtWidgets.QGraphicsEllipseItem
Source code in prettyqt\widgets\graphicsellipseitem.py
__repr__()
get_rect() -> core.RectF
GraphicsGridLayout
Bases: widgets.GraphicsLayoutMixin, QtWidgets.QGraphicsGridLayout
Source code in prettyqt\widgets\graphicsgridlayout.py
__add__(other: Iterable[QtWidgets.QGraphicsLayoutItem] | QtWidgets.QGraphicsLayoutItem)
Source code in prettyqt\widgets\graphicsgridlayout.py
__getitem__(idx: tuple[int, int] | int) -> QtWidgets.QGraphicsLayoutItem | None
__iter__() -> Iterator[QtWidgets.QWidget | QtWidgets.QLayout]
__reduce__()
__setitem__(idx: tuple[int | slice, int | slice], value: QtWidgets.QGraphicsLayoutItem)
Source code in prettyqt\widgets\graphicsgridlayout.py
__setstate__(state)
add(item: QtWidgets.QGraphicsLayoutItem, rowstart: int, colstart: int, rowspan: int = 1, colspan: int = 1)
append(item: QtWidgets.QGraphicsLayoutItem)
serialize_fields()
Source code in prettyqt\widgets\graphicsgridlayout.py
set_column_alignment(column: int, alignment: constants.AlignmentStr)
Source code in prettyqt\widgets\graphicsgridlayout.py
set_row_alignment(row: int, alignment: constants.AlignmentStr)
GraphicsItem
Bases: GraphicsItemMixin, QtWidgets.QGraphicsItem
GraphicsItemGroup
Bases: widgets.GraphicsItemMixin, QtWidgets.QGraphicsItemGroup
GraphicsItemMixin
Source code in prettyqt\widgets\graphicsitem.py
__contains__(value: QtCore.QPointF) -> bool
__getitem__(key: int)
__repr__()
__setitem__(key: int, value)
collides_with(item: QtGui.QPainterPath | QtWidgets.QGraphicsItem, mode: constants.ItemSelectionModeStr = 'intersects_shape') -> bool
Source code in prettyqt\widgets\graphicsitem.py
colliding_items(mode: constants.ItemSelectionModeStr = 'intersects_shape') -> list[QtWidgets.QGraphicsItem]
Source code in prettyqt\widgets\graphicsitem.py
get_cache_mode() -> CacheModeStr
Get the current mode modes as a string.
Returns:
| Type | Description |
|---|---|
CacheModeStr
|
cache mode |
get_panel_modality() -> PanelModalityStr
Get the current modality modes as a string.
Returns:
| Type | Description |
|---|---|
PanelModalityStr
|
panel modality |
get_shape() -> gui.PainterPath
set_cache_mode(mode: CacheModeStr) -> None
Set cache mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
CacheModeStr
|
cache mode |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
cache mode does not exist |
Source code in prettyqt\widgets\graphicsitem.py
set_focus(reason: constants.FocusReasonStr = 'other')
set_panel_modality(modality: PanelModalityStr) -> None
Set panel modality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modality |
PanelModalityStr
|
panel modality |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
panel modality does not exist |
Source code in prettyqt\widgets\graphicsitem.py
set_scale(scale: tuple[float, float] | float)
set_transform(transform: datatypes.TransformType, combine: bool = False)
GraphicsLayout
Bases: GraphicsLayoutMixin, QtWidgets.QGraphicsLayout
GraphicsLayoutItem
Bases: GraphicsLayoutItemMixin, QtWidgets.QGraphicsLayoutItem
GraphicsLayoutItemMixin
Source code in prettyqt\widgets\graphicslayoutitem.py
_(policy: QtWidgets.QSizePolicy)
__bool__()
__repr__()
get_size_policy() -> widgets.SizePolicy
set_size_policy(horizontal: widgets.sizepolicy.SizePolicyStr, vertical: widgets.sizepolicy.SizePolicyStr, control_type: widgets.sizepolicy.ControlTypeStr = 'default')
Set the size policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizontal |
widgets.sizepolicy.SizePolicyStr
|
horizontal size policy |
required |
vertical |
widgets.sizepolicy.SizePolicyStr
|
vertical size policy |
required |
control_type |
widgets.sizepolicy.ControlTypeStr
|
control type associated with the widget |
'default'
|
Source code in prettyqt\widgets\graphicslayoutitem.py
GraphicsLayoutMixin
Bases: widgets.GraphicsLayoutItemMixin
Source code in prettyqt\widgets\graphicslayout.py
__contains__(item)
__delitem__(index: int)
__getitem__(index: int) -> QtWidgets.QGraphicsItem
__iter__() -> Iterator[QtWidgets.QGraphicsItem]
__len__()
__setitem__(index: int, value: QtWidgets.QGraphicsItem)
get_children() -> list[QtWidgets.QGraphicsItem]
GraphicsLineItem
Bases: widgets.GraphicsItemMixin, QtWidgets.QGraphicsLineItem
Source code in prettyqt\widgets\graphicslineitem.py
GraphicsLinearLayout
Bases: widgets.GraphicsLayoutMixin, QtWidgets.QGraphicsLinearLayout
Source code in prettyqt\widgets\graphicslinearlayout.py
__add__(other)
__init__(orientation: constants.OrientationStr | QtCore.Qt.Orientation = 'horizontal', parent: QtWidgets.QGraphicsLayoutItem | None = None)
Source code in prettyqt\widgets\graphicslinearlayout.py
GraphicsObject
Bases: GraphicsObjectMixin, QtWidgets.QGraphicsObject
GraphicsObjectMixin
Bases: core.ObjectMixin, widgets.GraphicsItemMixin
GraphicsOpacityEffect
Bases: widgets.GraphicsEffectMixin, QtWidgets.QGraphicsOpacityEffect
Source code in prettyqt\widgets\graphicsopacityeffect.py
GraphicsPathItem
GraphicsPixmapItem
Bases: widgets.GraphicsItemMixin, QtWidgets.QGraphicsPixmapItem
Source code in prettyqt\widgets\graphicspixmapitem.py
get_pixmap() -> gui.Pixmap | None
get_shape_mode() -> ShapeModeStr
get_transformation_mode() -> constants.TransformationModeStr
Return current transformation mode.
Returns:
| Type | Description |
|---|---|
constants.TransformationModeStr
|
transformation mode |
set_shape_mode(mode: ShapeModeStr)
Set shape mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ShapeModeStr
|
shape mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\graphicspixmapitem.py
set_transformation_mode(mode: constants.TransformationModeStr)
Set transformation mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
constants.TransformationModeStr
|
transformation mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\graphicspixmapitem.py
GraphicsPolygonItem
Bases: widgets.AbstractGraphicsShapeItemMixin, QtWidgets.QGraphicsPolygonItem
Source code in prettyqt\widgets\graphicspolygonitem.py
get_fill_rule() -> constants.FillRuleStr
get_polygon() -> gui.PolygonF
serialize_fields()
GraphicsProxyWidget
Bases: widgets.GraphicsWidgetMixin, QtWidgets.QGraphicsProxyWidget
GraphicsRectItem
Bases: widgets.AbstractGraphicsShapeItemMixin, QtWidgets.QGraphicsRectItem
Source code in prettyqt\widgets\graphicsrectitem.py
__repr__()
__setstate__(state)
get_rect()
GraphicsRotation
Bases: widgets.GraphicsTransformMixin, QtWidgets.QGraphicsRotation
Source code in prettyqt\widgets\graphicsrotation.py
set_axis(axis: constants.AxisStr)
GraphicsScale
Bases: widgets.GraphicsTransformMixin, QtWidgets.QGraphicsScale
Source code in prettyqt\widgets\graphicsscale.py
GraphicsScene
Bases: core.ObjectMixin, QtWidgets.QGraphicsScene
Source code in prettyqt\widgets\graphicsscene.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
__getitem__(index: int) -> QtWidgets.QGraphicsItem
__setitem__(state)
Source code in prettyqt\widgets\graphicsscene.py
add(item) -> QtWidgets.QGraphicsItem
Source code in prettyqt\widgets\graphicsscene.py
add_ellipse(ellipse: datatypes.RectType | datatypes.RectFType, pen: QtGui.QPen | None = None, brush: QtGui.QBrush | None = None) -> widgets.GraphicsEllipseItem
Source code in prettyqt\widgets\graphicsscene.py
add_item_group(*items: QtWidgets.QGraphicsItem) -> widgets.GraphicsItemGroup
add_line(line: QtCore.QLineF | QtCore.QLine | tuple[float, float, float, float], pen: QtGui.QPen | None = None) -> widgets.GraphicsLineItem
Source code in prettyqt\widgets\graphicsscene.py
add_path(path: QtGui.QPainterPath, pen: QtGui.QPen | None = None, brush: QtGui.QBrush | None = None) -> widgets.GraphicsPathItem
Source code in prettyqt\widgets\graphicsscene.py
add_pixmap(pixmap: QtGui.QPixmap) -> widgets.GraphicsPixmapItem
add_polygon(polygon: QtGui.QPolygonF | QtGui.QPolygon, pen: QtGui.QPen | None = None, brush: QtGui.QBrush | None = None) -> widgets.GraphicsPolygonItem
Source code in prettyqt\widgets\graphicsscene.py
add_rect(rect: datatypes.RectType | datatypes.RectFType, pen: QtGui.QPen | None = None, brush: QtGui.QBrush | None = None) -> widgets.GraphicsRectItem
Source code in prettyqt\widgets\graphicsscene.py
add_simple_text(text: str, font: QtGui.QFont | None = None) -> widgets.GraphicsSimpleTextItem
Source code in prettyqt\widgets\graphicsscene.py
add_text(text: str, font: QtGui.QFont | None = None) -> widgets.GraphicsTextItem
Source code in prettyqt\widgets\graphicsscene.py
add_widget(widget: QtWidgets.QWidget) -> widgets.GraphicsProxyWidget
colliding_items(item: QtWidgets.QGraphicsItem, mode: constants.ItemSelectionModeStr = 'intersects_shape') -> list[QtWidgets.QGraphicsItem]
Source code in prettyqt\widgets\graphicsscene.py
get_background_brush() -> gui.Brush
get_font() -> gui.Font
get_foreground_brush() -> gui.Brush
get_item_index_method() -> ItemIndexMethodStr
Return item index method.
Returns:
| Type | Description |
|---|---|
ItemIndexMethodStr
|
item index method |
get_palette() -> gui.Palette
serialize_fields()
Source code in prettyqt\widgets\graphicsscene.py
set_item_index_method(method: ItemIndexMethodStr)
Set item index method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method |
ItemIndexMethodStr
|
item index method to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid item index method |
Source code in prettyqt\widgets\graphicsscene.py
GraphicsSimpleTextItem
Bases: widgets.AbstractGraphicsShapeItemMixin, QtWidgets.QGraphicsSimpleTextItem
Source code in prettyqt\widgets\graphicssimpletextitem.py
GraphicsTextItem
Bases: widgets.GraphicsObjectMixin, QtWidgets.QGraphicsTextItem
Source code in prettyqt\widgets\graphicstextitem.py
GraphicsTransform
Bases: GraphicsTransformMixin, QtWidgets.QGraphicsTransform
GraphicsTransformMixin
Bases: core.ObjectMixin
GraphicsView
Bases: GraphicsViewMixin, QtWidgets.QGraphicsView
GraphicsViewMixin
Bases: widgets.AbstractScrollAreaMixin
Source code in prettyqt\widgets\graphicsview.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
__getitem__(index: int) -> QtWidgets.QGraphicsItem
__setitem__(state)
Source code in prettyqt\widgets\graphicsview.py
get_background_brush() -> gui.Brush
get_cache_mode() -> CacheModeStr
get_drag_mode() -> DragModeStr
get_foreground_brush() -> gui.Brush
get_optimization_flags() -> list[OptimizationFlagStr]
get_resize_anchor() -> ViewportAnchorStr
Return current resize anchor.
Returns:
| Type | Description |
|---|---|
ViewportAnchorStr
|
resize anchor |
get_rubberband_selection_mode() -> constants.ItemSelectionModeStr
Return current rubberband selection mode.
Returns:
| Type | Description |
|---|---|
constants.ItemSelectionModeStr
|
rubberband selection mode |
Source code in prettyqt\widgets\graphicsview.py
get_transformation_anchor() -> ViewportAnchorStr
Return current transformation anchor.
Returns:
| Type | Description |
|---|---|
ViewportAnchorStr
|
viewport anchor |
get_viewport_update_mode() -> ViewportUpdateModeStr
Return current viewport update mode.
Returns:
| Type | Description |
|---|---|
ViewportUpdateModeStr
|
viewport update mode |
invalidate_scene(rect: QtCore.QRectF, layer: widgets.graphicsscene.SceneLayerStr = 'all')
Source code in prettyqt\widgets\graphicsview.py
serialize_fields()
Source code in prettyqt\widgets\graphicsview.py
set_cache_mode(mode: CacheModeStr)
Set the cache mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
CacheModeStr
|
cache mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\graphicsview.py
set_drag_mode(mode: DragModeStr)
Set the behavior for dragging the mouse while the left mouse button is pressed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
DragModeStr
|
drag mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\graphicsview.py
set_optimization_flags(*items: OptimizationFlagStr)
Source code in prettyqt\widgets\graphicsview.py
set_resize_anchor(mode: ViewportAnchorStr)
Set how the view should position the scene during resizes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ViewportAnchorStr
|
resize anchor to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\graphicsview.py
set_rubberband_selection_mode(mode: constants.ItemSelectionModeStr)
Set the behavior for selecting items with a rubber band selection rectangle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
constants.ItemSelectionModeStr
|
rubberband selection mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\graphicsview.py
set_transform(transform: datatypes.TransformType, combine: bool = False)
set_transformation_anchor(mode: ViewportAnchorStr)
Set how the view should position the scene during transformations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ViewportAnchorStr
|
transformation anchor to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\graphicsview.py
set_viewport_update_mode(mode: ViewportUpdateModeStr)
Set how the viewport should update its contents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ViewportUpdateModeStr
|
viewport update mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
mode does not exist |
Source code in prettyqt\widgets\graphicsview.py
GraphicsWidget
Bases: GraphicsWidgetMixin, QtWidgets.QGraphicsWidget
GraphicsWidgetMixin
Bases: widgets.GraphicsObjectMixin, widgets.GraphicsLayoutItemMixin
Source code in prettyqt\widgets\graphicswidget.py
get_focus_policy() -> constants.FocusPolicyStr
Return way the widget accepts keyboard focus.
Returns:
| Name | Type | Description |
|---|---|---|
str |
constants.FocusPolicyStr
|
Focus policy |
get_font() -> gui.Font
get_palette() -> gui.Palette
set_focus_policy(policy: constants.FocusPolicyStr) -> None
Set the way the widget accepts keyboard focus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
constants.FocusPolicyStr
|
Focus policy |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
Description |
Source code in prettyqt\widgets\graphicswidget.py
set_layout(layout: LayoutStr | QtWidgets.QGraphicsLayout | None)
Source code in prettyqt\widgets\graphicswidget.py
window_frame_section_at(point: datatypes.PointType) -> constants.WindowFrameSectionStr
Return the window frame section at given position.
Returns:
| Name | Type | Description |
|---|---|---|
str |
constants.WindowFrameSectionStr
|
Window frame section |
Source code in prettyqt\widgets\graphicswidget.py
GridLayout
Bases: widgets.LayoutMixin, QtWidgets.QGridLayout
Source code in prettyqt\widgets\gridlayout.py
__add__(other: tuple | list | QtWidgets.QWidget | QtWidgets.QLayout | QtWidgets.QLayoutItem)
Source code in prettyqt\widgets\gridlayout.py
__getitem__(idx: tuple[int, int] | int | str) -> QtWidgets.QWidget | QtWidgets.QLayout | None
Source code in prettyqt\widgets\gridlayout.py
__iter__() -> Iterator[QtWidgets.QWidget | QtWidgets.QLayout]
__setitem__(idx: tuple[int | slice, int | slice], value: QtWidgets.QWidget | QtWidgets.QLayout | QtWidgets.QLayoutItem)
Source code in prettyqt\widgets\gridlayout.py
add(item: QtWidgets.QWidget | QtWidgets.QLayout | QtWidgets.QLayoutItem, rowstart: int, colstart: int, rowspan: int = 1, colspan: int = 1)
Source code in prettyqt\widgets\gridlayout.py
append(item: QtWidgets.QWidget | QtWidgets.QLayout | QtWidgets.QLayoutItem)
get_origin_corner() -> constants.CornerStr
GroupBox
Bases: widgets.WidgetMixin, QtWidgets.QGroupBox
GroupBox widget.
A group box provides a frame, a title on top, a keyboard shortcut, and displays various other widgets inside itself. The keyboard shortcut moves keyboard focus to one of the group box's child widgets.
Source code in prettyqt\widgets\groupbox.py
__init__(title: str = '', checkable: bool = False, parent: QtWidgets.QWidget | None = None)
__repr__()
set_alignment(alignment)
set_enabled(state)
HeaderView
InputDialog
Bases: widgets.DialogMixin, QtWidgets.QInputDialog
Source code in prettyqt\widgets\inputdialog.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
get_float(title: str = '', label: str = '', icon: datatypes.IconType = None) -> float | None
classmethod
Source code in prettyqt\widgets\inputdialog.py
get_input_mode() -> InputModeStr
get_int(title: str = '', label: str = '', icon: datatypes.IconType = None) -> int | None
classmethod
Source code in prettyqt\widgets\inputdialog.py
get_item(items: list[str], title: str = '', label: str = '', icon: datatypes.IconType = None, editable: bool = False) -> str | None
classmethod
Source code in prettyqt\widgets\inputdialog.py
get_text(title: str = '', label: str = '', icon: datatypes.IconType = None, default_value: str = '', echo_mode: widgets.lineedit.EchoModeStr = 'normal') -> str | None
classmethod
Source code in prettyqt\widgets\inputdialog.py
get_text_echo_mode() -> widgets.lineedit.EchoModeStr
set_input_mode(mode: InputModeStr)
Set input mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
InputModeStr
|
input mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid input mode |
Source code in prettyqt\widgets\inputdialog.py
set_text_echo_mode(mode: widgets.lineedit.EchoModeStr)
Set text echo mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
widgets.lineedit.EchoModeStr
|
echo mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid echo mode |
Source code in prettyqt\widgets\inputdialog.py
ItemDelegate
Bases: widgets.AbstractItemDelegateMixin, QtWidgets.QItemDelegate
ItemEditorCreatorBase
ItemEditorFactory
Bases: QtWidgets.QItemEditorFactory
Source code in prettyqt\widgets\itemeditorfactory.py
register_default_editor(editor_cls: type[QtWidgets.QWidget], typ: int | None = None)
classmethod
register_editor(editor_cls: type[QtWidgets.QWidget], typ: int | None = None, property_name: str = '')
Source code in prettyqt\widgets\itemeditorfactory.py
KeySequenceEdit
Bases: widgets.WidgetMixin, QtWidgets.QKeySequenceEdit
Source code in prettyqt\widgets\keysequenceedit.py
value_changed = core.Signal(QtGui.QKeySequence)
class-attribute
__init__(*args, **kwargs)
__repr__()
get_value() -> str
is_valid() -> bool
LCDNumber
Bases: widgets.FrameMixin, QtWidgets.QLCDNumber
Source code in prettyqt\widgets\lcdnumber.py
get_mode() -> ModeStr
get_segment_style() -> SegmentStyleStr
Return current segment style.
Returns:
| Type | Description |
|---|---|
SegmentStyleStr
|
segment style |
get_value() -> float
set_mode(mode: ModeStr)
Set the lcd mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ModeStr
|
lcd mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
lcd mode does not exist |
Source code in prettyqt\widgets\lcdnumber.py
set_segment_style(mode: SegmentStyleStr)
Set the segment style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
SegmentStyleStr
|
segment style to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
segment style does not exist |
Source code in prettyqt\widgets\lcdnumber.py
Label
Bases: widgets.FrameMixin, QtWidgets.QLabel
Source code in prettyqt\widgets\label.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
__init__(*args, **kwargs)
__repr__()
allow_links() -> Label
Source code in prettyqt\widgets\label.py
get_horizontal_alignment() -> constants.HorizontalAlignmentStr
Source code in prettyqt\widgets\label.py
get_text_format() -> TextFormatStr
get_text_interaction() -> list[TextInteractionStr]
Return current text interaction mode.
Returns:
| Type | Description |
|---|---|
list[TextInteractionStr]
|
list of text interaction modes |
get_vertical_alignment() -> constants.VerticalAlignmentStr
Source code in prettyqt\widgets\label.py
image_from_path(path: datatypes.PathType, parent: QtWidgets.QWidget | None = None) -> Label
classmethod
Source code in prettyqt\widgets\label.py
set_alignment(horizontal: constants.HorizontalAlignmentStr | None = None, vertical: constants.VerticalAlignmentStr | None = None)
Set the alignment of the label's contents.
Source code in prettyqt\widgets\label.py
set_bold(bold: bool = True) -> Label
set_color(color: datatypes.ColorType) -> Label
set_image(path: datatypes.PathType, width: int = 300) -> Label
Source code in prettyqt\widgets\label.py
set_indent(indent: int) -> Label
set_italic(italic: bool = True) -> Label
set_point_size(size: int) -> Label
set_text(text: str) -> Label
set_text_format(text_format: TextFormatStr) -> Label
Set the text format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_format |
TextFormatStr
|
text format to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
text format does not exist |
Source code in prettyqt\widgets\label.py
set_text_interaction(*types: TextInteractionStr) -> Label
Set the text interaction mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
types |
TextInteractionStr
|
text interaction mode to use |
()
|
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
text interaction mode does not exist |
Source code in prettyqt\widgets\label.py
set_weight(weight: gui.font.WeightStr) -> Label
Set the font weight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
weight |
gui.font.WeightStr
|
font weight |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid font weight |
Source code in prettyqt\widgets\label.py
Layout
Bases: LayoutMixin, QtWidgets.QLayout
LayoutItem
Bases: LayoutItemMixin, QtWidgets.QLayoutItem
LayoutItemMixin
Source code in prettyqt\widgets\layoutitem.py
__bool__()
get_alignment() -> constants.AlignmentStr
get_control_types() -> list[widgets.sizepolicy.ControlTypeStr]
get_expanding_directions() -> list[constants.OrientationStr]
get_item() -> QtWidgets.QWidget | QtWidgets.QLayout | QtWidgets.QSpacerItem | None
Source code in prettyqt\widgets\layoutitem.py
set_alignment(alignment: constants.AlignmentStr)
Set the alignment of the layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment |
constants.AlignmentStr
|
alignment for the layout |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
alignment does not exist |
Source code in prettyqt\widgets\layoutitem.py
LayoutMixin
Bases: core.ObjectMixin, widgets.LayoutItemMixin
Source code in prettyqt\widgets\layout.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
__contains__(item: QtWidgets.QWidget | QtWidgets.QLayoutItem)
__delitem__(index: int)
__getitem__(index: str | int) -> QtWidgets.QWidget | QtWidgets.QLayout | None
Source code in prettyqt\widgets\layout.py
__iter__() -> Iterator[QtWidgets.QWidget | QtWidgets.QLayout | None]
__len__() -> int
add(*items: QtWidgets.QWidget | QtWidgets.QLayout)
Source code in prettyqt\widgets\layout.py
add_widget(widget: QtWidgets.QWidget)
get_children() -> list[QtWidgets.QWidget | QtWidgets.QLayout]
get_size_constraint() -> SizeConstraintStr
get_size_mode() -> SizeConstraintStr
serialize_fields()
set_alignment(alignment: constants.AlignmentStr, item: QtWidgets.QWidget | QtWidgets.QLayout | None = None) -> bool
Set the alignment for widget / layout to alignment.
Returns true if w is found in this layout (not including child layouts).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment |
constants.AlignmentStr
|
alignment for the layout |
required |
item |
QtWidgets.QWidget | QtWidgets.QLayout | None
|
set alignment for specific child only |
None
|
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
alignment does not exist |
Source code in prettyqt\widgets\layout.py
set_margin(margin: int)
set_size_constraint(mode: SizeConstraintStr)
Set the size mode of the layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
SizeConstraintStr
|
size mode for the layout |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
size mode does not exist |
Source code in prettyqt\widgets\layout.py
set_size_mode(mode: SizeConstraintStr)
LineEdit
Bases: widgets.WidgetMixin, QtWidgets.QLineEdit
Source code in prettyqt\widgets\lineedit.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
value_changed = core.Signal(str)
class-attribute
__add__(other: str)
__init__(default_value: str = '', read_only: bool = False, parent: QtWidgets.QWidget | None = None)
Source code in prettyqt\widgets\lineedit.py
__repr__()
add_action(action: QtWidgets.QAction, position: ActionPositionStr = 'trailing')
append_text(text: str)
font() -> gui.Font
get_cursor_move_style() -> constants.CursorMoveStyleStr
get_echo_mode() -> EchoModeStr
get_value() -> str
is_valid() -> bool
set_cursor_move_style(style: constants.CursorMoveStyleStr)
Set cursor move style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style |
constants.CursorMoveStyleStr
|
cursor move style to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid cursor move style |
Source code in prettyqt\widgets\lineedit.py
set_echo_mode(mode: EchoModeStr)
Set echo mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
EchoModeStr
|
echo mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid echo mode |
Source code in prettyqt\widgets\lineedit.py
set_input_mask(mask: str)
set_range(lower: int | None, upper: int | None)
set_read_only(value: bool = True)
Set text to read-only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
bool
|
True, for read-only, otherwise False |
True
|
set_regex_validator(regex: str, flags = 0) -> gui.RegularExpressionValidator
set_text(text: str)
set_validator(validator: gui.Validator)
ListView
Bases: ListViewMixin, QtWidgets.QListView
ListViewMixin
Bases: widgets.AbstractItemViewMixin
Source code in prettyqt\widgets\listview.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
get_flow() -> FlowStr
get_grid_size() -> core.Size
get_layout_mode() -> LayoutModeStr
get_movement() -> MovementStr
get_resize_mode() -> ResizeModeStr
get_view_mode() -> ViewModeStr
set_flow(mode: FlowStr)
Set flow mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
FlowStr
|
flow mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid flow mode |
Source code in prettyqt\widgets\listview.py
set_grid_size(size: QtCore.QSize | tuple[int, int])
set_layout_mode(mode: LayoutModeStr)
Set layout mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
LayoutModeStr
|
layout mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid layout mode |
Source code in prettyqt\widgets\listview.py
set_movement(mode: MovementStr)
Set movement mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
MovementStr
|
movement mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid movement mode |
Source code in prettyqt\widgets\listview.py
set_resize_mode(mode: ResizeModeStr)
Set resize mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ResizeModeStr
|
resize mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid resize mode |
Source code in prettyqt\widgets\listview.py
set_view_mode(mode: ViewModeStr)
Set view mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ViewModeStr
|
view mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid view mode |
Source code in prettyqt\widgets\listview.py
ListWidget
Bases: widgets.ListViewMixin, QtWidgets.QListWidget
Source code in prettyqt\widgets\listwidget.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
value_changed = core.Signal(object)
class-attribute
__add__(other: QtWidgets.QListWidgetItem)
__delitem__(row: int)
__getitem__(row: int) -> QtWidgets.QListWidgetItem
__init__(parent: QtWidgets.QWidget | None = None, selection_mode: str = 'single')
__iter__() -> Iterator[QtWidgets.QListWidgetItem]
__len__() -> int
__repr__()
add(label: str, data = NoData, icon: datatypes.IconType = None)
Source code in prettyqt\widgets\listwidget.py
add_item(name: str = '', icon: datatypes.IconType = None, data: dict | None = None, foreground: QtGui.QBrush | None = None, background: QtGui.QBrush | None = None, font: QtGui.QFont | None = None, selected: bool = None, status_tip: str | None = None, tool_tip: str | None = None, whats_this: str | None = None, checkstate: constants.StateStr | None = None, flags: QtCore.Qt.ItemFlag | None = None, size_hint: datatypes.SizeType | None = None, is_user_type: bool = False) -> widgets.ListWidgetItem
Source code in prettyqt\widgets\listwidget.py
add_items(items: Iterable | Mapping)
find_items(text: str, column: int = 0, mode: constants.MatchFlagStr = 'exact') -> list[QtGui.QStandardItem]
Source code in prettyqt\widgets\listwidget.py
get_children() -> list[QtWidgets.QListWidgetItem]
get_value() -> list[Any]
on_index_change()
scroll_to_item(item: QtWidgets.QListWidgetItem, mode: widgets.abstractitemview.ScrollHintStr = 'ensure_visible')
Source code in prettyqt\widgets\listwidget.py
set_value(value)
ListWidgetItem
Bases: serializemixin.SerializeMixin, QtWidgets.QListWidgetItem
Source code in prettyqt\widgets\listwidgetitem.py
__getitem__(index: int)
__repr__()
__setitem__(index: int, value)
get_background() -> gui.Brush
get_checkstate() -> constants.StateStr
get_font() -> gui.Font
get_foreground() -> gui.Brush
get_icon() -> gui.Icon | None
serialize_fields()
set_checkstate(state: constants.StateStr)
set_data(role: str, data)
set_icon(icon: datatypes.IconType)
Set the icon for the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon |
datatypes.IconType
|
icon to use |
required |
set_size_hint(hint: datatypes.SizeType)
set_text_alignment(horizontal: constants.HorizontalAlignmentStr | None = None, vertical: constants.VerticalAlignmentStr | None = None)
Set text alignment of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizontal |
constants.HorizontalAlignmentStr | None
|
horizontal text alignment to use |
None
|
vertical |
constants.VerticalAlignmentStr | None
|
vertical text alignment to use |
None
|
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid text alignment |
Source code in prettyqt\widgets\listwidgetitem.py
MainWindow
Bases: widgets.WidgetMixin, QtWidgets.QMainWindow
Class for our mainWindow.
Includes all docks, a centralwidget and a toolbar
Source code in prettyqt\widgets\mainwindow.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
__getitem__(index: str) -> QtWidgets.QWidget
__init__(*args, **kwargs)
Source code in prettyqt\widgets\mainwindow.py
add_dockwidget(dockwidget: QtWidgets.QDockWidget, position: constants.DockPositionStr = 'left')
add_toolbar(toolbar: QtWidgets.QToolBar, position: constants.ToolbarAreaStr = 'top')
Adds a toolbar to the mainmenu at specified area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
toolbar |
QtWidgets.QToolBar
|
toolbar to use |
required |
position |
constants.ToolbarAreaStr
|
position of the toolbar |
'top'
|
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
position does not exist |
Source code in prettyqt\widgets\mainwindow.py
add_toolbar_break(position: constants.ToolbarAreaStr = 'top')
Adds a toolbar break to the given area behind the last item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position |
constants.ToolbarAreaStr
|
position of the toolbar |
'top'
|
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
position does not exist |
Source code in prettyqt\widgets\mainwindow.py
add_widget_as_dock(name: str, title: str, vertical: bool = True, position: constants.DockPositionStr = 'left') -> widgets.DockWidget
Source code in prettyqt\widgets\mainwindow.py
createPopupMenu() -> widgets.Menu
Source code in prettyqt\widgets\mainwindow.py
get_docks() -> list[QtWidgets.QDockWidget]
get_toolbars() -> list[QtWidgets.QToolBar]
load_window_state(recursive: bool = False) -> bool
Source code in prettyqt\widgets\mainwindow.py
remove_dockwidgets(dockwidgets: Sequence[QtWidgets.QDockWidget])
save_window_state(recursive: bool = False)
Save current window state as QSetting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recursive |
bool
|
Description |
False
|
Source code in prettyqt\widgets\mainwindow.py
set_widget(widget: QtWidgets.QWidget | None)
MdiArea
Bases: widgets.AbstractScrollAreaMixin, QtWidgets.QMdiArea
Source code in prettyqt\widgets\mdiarea.py
__add__(other: QtWidgets.QWidget)
add(*item: QtWidgets.QWidget)
get_background() -> gui.Brush
get_tab_position() -> TabPositionStr
get_view_mode() -> ViewModeStr
get_window_order() -> WindowOrderStr
set_background(brush_or_color: datatypes.ColorAndBrushType, pattern: constants.BrushStyleStr = 'solid')
Source code in prettyqt\widgets\mdiarea.py
set_tab_position(position: TabPositionStr)
Set tab position for the MDI area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position |
TabPositionStr
|
tabs position to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
tab position does not exist |
Source code in prettyqt\widgets\mdiarea.py
set_view_mode(mode: ViewModeStr)
Set view mode for the MDI area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
ViewModeStr
|
view mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
view mode does not exist |
Source code in prettyqt\widgets\mdiarea.py
set_window_order(mode: WindowOrderStr)
Set the window order behaviour for the MDI area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
WindowOrderStr
|
window order behaviour to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
window order mode not existing. |
Source code in prettyqt\widgets\mdiarea.py
MdiSubWindow
Bases: widgets.WidgetMixin, QtWidgets.QMdiSubWindow
Source code in prettyqt\widgets\mdisubwindow.py
Menu
MenuBar
Bases: widgets.WidgetMixin, QtWidgets.QMenuBar
Source code in prettyqt\widgets\menubar.py
__add__(other: QtWidgets.QAction | QtWidgets.QMenu)
add(*items: QtWidgets.QMenu | QtWidgets.QAction)
Source code in prettyqt\widgets\menubar.py
add_action(action: QtWidgets.QAction | str) -> QtWidgets.QAction
add_menu(menu_or_str)
Source code in prettyqt\widgets\menubar.py
add_separator()
get_corner_widget(corner: Literal['top_right', 'top_left'] = 'top_right') -> QtWidgets.QWidget
Source code in prettyqt\widgets\menubar.py
serialize_fields()
set_corner_widget(widget: QtWidgets.QWidget, corner: Literal['top_right', 'top_left'] = 'top_right')
Source code in prettyqt\widgets\menubar.py
MessageBox
Bases: widgets.DialogMixin, QtWidgets.QMessageBox
Source code in prettyqt\widgets\messagebox.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
__init__(icon: datatypes.IconType | IconStr = None, title: str = '', text: str = '', informative_text: str = '', details: str = '', buttons: list[ButtonStr] | None = None, parent: QtWidgets.QWidget | None = None)
Source code in prettyqt\widgets\messagebox.py
add_button(button: ButtonStr) -> QtWidgets.QPushButton
Add a default button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button |
ButtonStr
|
button to add |
required |
Returns:
| Type | Description |
|---|---|
QtWidgets.QPushButton
|
created button |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
Button type not available |
Source code in prettyqt\widgets\messagebox.py
get_icon_pixmap() -> gui.Pixmap | None
get_standard_buttons() -> list[ButtonStr]
get_text_format() -> TextFormatStr
message(text: str, title: str = '', icon: datatypes.IconType = None, detail_text: str | None = None) -> str
classmethod
Source code in prettyqt\widgets\messagebox.py
serialize_fields()
Source code in prettyqt\widgets\messagebox.py
set_default_button(button: ButtonStr | QtWidgets.QPushButton)
set_escape_button(button: ButtonStr | QtWidgets.QAbstractButton)
set_icon(icon: datatypes.IconType | IconStr)
set_text_format(text_format: TextFormatStr)
Set the text format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_format |
TextFormatStr
|
text format to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
text format does not exist |
Source code in prettyqt\widgets\messagebox.py
show_blocking() -> ButtonStr
show_exception(exception: Exception)
classmethod
PanGesture
Bases: widgets.GestureMixin, QtWidgets.QPanGesture
Source code in prettyqt\widgets\pangesture.py
get_delta() -> core.PointF
get_last_offset() -> core.PointF
PinchGesture
Bases: widgets.GestureMixin, QtWidgets.QPinchGesture
Source code in prettyqt\widgets\pinchgesture.py
get_center_point() -> core.PointF
get_change_flags() -> list[ChangeFlagStr]
get_last_center_point() -> core.PointF
get_start_center_point() -> core.PointF
get_total_change_flags() -> list[ChangeFlagStr]
set_change_flags(**kwargs)
Source code in prettyqt\widgets\pinchgesture.py
set_total_change_flags(**kwargs)
Source code in prettyqt\widgets\pinchgesture.py
PlainTextDocumentLayout
Bases: gui.AbstractTextDocumentLayoutMixin, QtWidgets.QPlainTextDocumentLayout
Source code in prettyqt\widgets\plaintextdocumentlayout.py
PlainTextEdit
Bases: PlainTextEditMixin, QtWidgets.QPlainTextEdit
PlainTextEditMixin
Bases: widgets.AbstractScrollAreaMixin
Source code in prettyqt\widgets\plaintextedit.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
validator: QtGui.QValidator | None = None
instance-attribute
value_changed = core.Signal()
class-attribute
__add__(other: str)
__init__(text: str = '', parent: QtWidgets.QWidget | None = None, read_only: bool = False)
Source code in prettyqt\widgets\plaintextedit.py
allow_wheel_zoom(do_zoom: bool = True)
append_text(text: str, newline: bool = True)
create_cursor() -> Iterator[gui.TextCursor]
current_cursor() -> Iterator[gui.TextCursor]
get_current_line() -> int
get_line_wrap_mode() -> LineWrapModeStr
Get the current wrap mode.
Returns:
| Type | Description |
|---|---|
LineWrapModeStr
|
Wrap mode |
get_selected_rows() -> tuple[int, int]
Source code in prettyqt\widgets\plaintextedit.py
get_selected_text() -> str
get_text_cursor() -> gui.TextCursor
get_value() -> str
get_word_wrap_mode() -> gui.textoption.WordWrapModeStr
Get the current word wrap mode.
Returns:
| Type | Description |
|---|---|
gui.textoption.WordWrapModeStr
|
Word wrap mode |
get_wrap_mode() -> gui.textoption.WordWrapModeStr
goto_line(line_no: int)
Source code in prettyqt\widgets\plaintextedit.py
highlight_current_line(color: datatypes.ColorType = None)
Source code in prettyqt\widgets\plaintextedit.py
is_valid() -> bool
move_cursor(operation: gui.textcursor.MoveOperationStr, mode: gui.textcursor.MoveModeStr = 'move')
select_text(start: int, end: int)
set_line_wrap_mode(mode: LineWrapModeStr)
Set line wrap mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
LineWrapModeStr
|
line wrap mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
line wrap mode does not exist |
Source code in prettyqt\widgets\plaintextedit.py
set_read_only(value: bool = True)
Make the PlainTextEdit read-only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
bool
|
True, for read-only, otherwise False |
True
|
set_regex_validator(regex: str, flags = 0) -> gui.RegularExpressionValidator
set_syntaxhighlighter(syntax: str, style: str | None = None)
set_text(text: str)
set_validator(validator: QtGui.QValidator | None)
set_value(value: str)
set_word_wrap_mode(mode: gui.textoption.WordWrapModeStr)
Set word wrap mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
gui.textoption.WordWrapModeStr
|
word wrap mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
wrap mode does not exist |
Source code in prettyqt\widgets\plaintextedit.py
set_wrap_mode(mode: gui.textoption.WordWrapModeStr)
show_whitespace_and_tabs(show: bool)
Set show white spaces flag.
Source code in prettyqt\widgets\plaintextedit.py
text() -> str
wheelEvent(event)
Handle wheel event for zooming.
Source code in prettyqt\widgets\plaintextedit.py
ProgressBar
Bases: widgets.WidgetMixin, QtWidgets.QProgressBar
Progress dialog.
wrapper for QtWidgets.QProgressBar
Source code in prettyqt\widgets\progressbar.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
__init__(text_visible: bool = True, parent: QtWidgets.QWidget | None = None)
get_alignment() -> constants.AlignmentStr
get_orientation() -> constants.OrientationStr
get_text_direction() -> TextDirectionStr
Return current text direction.
Returns:
| Type | Description |
|---|---|
TextDirectionStr
|
Text direction |
get_value() -> int
serialize_fields()
Source code in prettyqt\widgets\progressbar.py
set_alignment(alignment: constants.AlignmentStr)
Set the alignment of the layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment |
constants.AlignmentStr
|
alignment for the layout |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
alignment does not exist |
Source code in prettyqt\widgets\progressbar.py
set_orientation(orientation: constants.OrientationStr)
Set the orientation of the progress bar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation |
constants.OrientationStr
|
orientation for the progress bar |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
orientation does not exist |
Source code in prettyqt\widgets\progressbar.py
set_range(start: int, end: int)
set_text_direction(text_direction: TextDirectionStr)
Set the text direction of the layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_direction |
TextDirectionStr
|
text direction for the layout |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
text direction does not exist |
Source code in prettyqt\widgets\progressbar.py
ProgressDialog
Bases: widgets.DialogMixin, QtWidgets.QProgressDialog
Progress dialog.
Wrapper for QtWidgets.QProgressDialog
Source code in prettyqt\widgets\progressdialog.py
__init__(parent: QtWidgets.QWidget | None = None)
Source code in prettyqt\widgets\progressdialog.py
ProxyStyle
Bases: widgets.CommonStyleMixin, QtWidgets.QProxyStyle
PushButton
Bases: PushButtonMixin, QtWidgets.QPushButton
PushButtonMixin
Bases: widgets.AbstractButtonMixin
Source code in prettyqt\widgets\pushbutton.py
value_changed = core.Signal(bool)
class-attribute
__init__(label: str | None = None, parent: QtWidgets.QWidget | None = None, callback: Callable | None = None)
Source code in prettyqt\widgets\pushbutton.py
RadioButton
Bases: widgets.AbstractButtonMixin, QtWidgets.QRadioButton
Source code in prettyqt\widgets\radiobutton.py
RubberBand
ScrollArea
Bases: widgets.AbstractScrollAreaMixin, QtWidgets.QScrollArea
Source code in prettyqt\widgets\scrollarea.py
ScrollBar
Scroller
Bases: core.ObjectMixin
Source code in prettyqt\widgets\scroller.py
item = item
instance-attribute
__getattr__(val)
__init__(item: QtWidgets.QScroller)
get_final_position() -> core.PointF
get_pixel_per_meter() -> core.PointF
get_scroller(obj: QtCore.QObject)
classmethod
get_scroller_properties() -> widgets.ScrollerProperties
get_state() -> StateStr
get_velocity() -> core.PointF
grab_gesture(target: QtCore.QObject, gesture_type: ScrollGestureTypeStr = 'touch') -> constants.GestureTypeStr
staticmethod
Source code in prettyqt\widgets\scroller.py
grabbed_gesture(target: QtCore.QObject) -> constants.GestureTypeStr
staticmethod
handle_input(input_type: InputStr, position: datatypes.PointFType, timestamp: int = 0) -> bool
Source code in prettyqt\widgets\scroller.py
ScrollerProperties
Bases: QtWidgets.QScrollerProperties
Source code in prettyqt\widgets\scrollerproperties.py
__getitem__(metric: ScrollmetricStr)
__iter__()
__setitem__(metric: ScrollmetricStr, value: Any)
get_scroll_metric(metric: ScrollmetricStr) -> Any
Return scroll metric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric |
ScrollmetricStr
|
Scroll metric to get |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
metric does not exist |
Returns:
| Type | Description |
|---|---|
Any
|
state |
Source code in prettyqt\widgets\scrollerproperties.py
get_scroll_metrics() -> dict
keys()
set_scroll_metric(metric: ScrollmetricStr, value: Any)
Set scroll metric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric |
ScrollmetricStr
|
Scroll metric to set |
required |
value |
Any
|
Value to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
metric does not exist |
Source code in prettyqt\widgets\scrollerproperties.py
Shortcut
Bases: core.ObjectMixin, QtWidgets.QShortcut
Source code in prettyqt\widgets\shortcut.py
__str__()
get_context() -> constants.ContextStr
get_key() -> gui.KeySequence
serialize_field()
set_context(context: constants.ContextStr)
Set shortcut context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context |
constants.ContextStr
|
shortcut context |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
shortcut context does not exist |
Source code in prettyqt\widgets\shortcut.py
SizeGrip
Bases: widgets.WidgetMixin, QtWidgets.QSizeGrip
SizePolicy
Bases: prettyprinter.PrettyPrinter, QtWidgets.QSizePolicy
Source code in prettyqt\widgets\sizepolicy.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
__getstate__()
Source code in prettyqt\widgets\sizepolicy.py
__reduce__()
__repr__() -> str
__setstate__(state: dict[str, Any]) -> None
Source code in prettyqt\widgets\sizepolicy.py
clone(qpol: QtWidgets.QSizePolicy) -> SizePolicy
classmethod
Source code in prettyqt\widgets\sizepolicy.py
get_control_type() -> ControlTypeStr
get_horizontal_policy() -> SizePolicyStr
Return size policy.
Returns:
| Type | Description |
|---|---|
SizePolicyStr
|
horizontal size policy |
get_vertical_policy() -> SizePolicyStr
Return size policy.
Returns:
| Type | Description |
|---|---|
SizePolicyStr
|
vertical size policy |
serialize() -> dict[str, Any]
set_control_type(typ: ControlTypeStr) -> None
Set the control type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ |
ControlTypeStr
|
control type to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
control type does not exist |
Source code in prettyqt\widgets\sizepolicy.py
set_horizontal_policy(policy: SizePolicyStr) -> None
Set the horizontal policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
SizePolicyStr
|
policy to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
policy does not exist |
Source code in prettyqt\widgets\sizepolicy.py
set_vertical_policy(policy: SizePolicyStr) -> None
Set the horizontal policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
SizePolicyStr
|
policy to set |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
policy does not exist |
Source code in prettyqt\widgets\sizepolicy.py
Slider
Bases: widgets.AbstractSliderMixin, QtWidgets.QSlider
Source code in prettyqt\widgets\slider.py
value_changed = core.Signal(int)
class-attribute
__init__(orientation: constants.OrientationStr | QtCore.Qt.Orientation = 'horizontal', parent: QtWidgets.QWidget | None = None)
Source code in prettyqt\widgets\slider.py
get_tick_position() -> TickPositionStr
set_tick_position(position: TickPositionAllStr)
Set the tick position for the slider.
For vertical orientation, "above" equals to "left" and "below" to "right".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position |
TickPositionAllStr
|
position for the ticks |
required |
Source code in prettyqt\widgets\slider.py
SpacerItem
Bases: widgets.LayoutItemMixin, QtWidgets.QSpacerItem
Source code in prettyqt\widgets\spaceritem.py
__init__(w: int, h: int, h_policy: QtWidgets.QSizePolicy.Policy | widgets.sizepolicy.SizePolicyStr = 'minimum', v_policy: QtWidgets.QSizePolicy.Policy | widgets.sizepolicy.SizePolicyStr = 'minimum')
Source code in prettyqt\widgets\spaceritem.py
change_size(w: int, h: int, h_policy: widgets.sizepolicy.SizePolicyStr = 'minimum', v_policy: widgets.sizepolicy.SizePolicyStr = 'minimum')
Source code in prettyqt\widgets\spaceritem.py
SpinBox
Bases: widgets.AbstractSpinBoxMixin, QtWidgets.QSpinBox
Source code in prettyqt\widgets\spinbox.py
value_changed = core.Signal(int)
class-attribute
__init__(parent: QtWidgets.QWidget | None = None, min_value: int | None = None, max_value: int | None = None, default_value: int | None = None)
Source code in prettyqt\widgets\spinbox.py
set_range(start: int | None, end: int | None)
SplashScreen
Splitter
SplitterHandle
Bases: widgets.WidgetMixin, QtWidgets.QSplitterHandle
Source code in prettyqt\widgets\splitterhandle.py
__init__(orientation: constants.OrientationStr | QtCore.Qt.Orientation, parent: QtWidgets.QSplitter)
Source code in prettyqt\widgets\splitterhandle.py
get_orientation() -> constants.OrientationStr
set_orientation(orientation: constants.OrientationStr)
Set the orientation of the slider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation |
constants.OrientationStr
|
orientation for the slider |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
orientation does not exist |
Source code in prettyqt\widgets\splitterhandle.py
StackedLayout
Bases: widgets.LayoutMixin, QtWidgets.QStackedLayout
Source code in prettyqt\widgets\stackedlayout.py
__add__(other: QtWidgets.QWidget | QtWidgets.QLayout)
StackedWidget
Bases: widgets.FrameMixin, QtWidgets.QStackedWidget
Source code in prettyqt\widgets\stackedwidget.py
__add__(other: QtWidgets.QWidget) -> StackedWidget
__contains__(item: QtWidgets.QWidget)
__getitem__(index: int) -> QtWidgets.QWidget
__iter__() -> Iterator[QtWidgets.QWidget]
__len__()
serialize_fields()
StatusBar
Bases: widgets.WidgetMixin, QtWidgets.QStatusBar
Source code in prettyqt\widgets\statusbar.py
progress_bar = widgets.ProgressBar()
instance-attribute
__add__(other: QtWidgets.QAction | QtWidgets.QWidget) -> StatusBar
Source code in prettyqt\widgets\statusbar.py
__init__(*args, **kwargs) -> None
add_action(action: QtWidgets.QAction) -> None
add_widget(widget: QtWidgets.QWidget, permanent: bool = False) -> None
setup_default_bar() -> None
Source code in prettyqt\widgets\statusbar.py
Style
Bases: StyleMixin, QtWidgets.QStyle
StyleFactory
StyleMixin
Bases: core.ObjectMixin
Source code in prettyqt\widgets\style.py
draw_control(control: ControlElementStr, option: QtWidgets.QStyleOption, painter: QtGui.QPainter, widget: QtWidgets.QWidget | None = None)
Source code in prettyqt\widgets\style.py
draw_primitive(element: SimpleControlStr, option: QtWidgets.QStyleOption, painter: QtGui.QPainter, widget: QtWidgets.QWidget | None = None)
Source code in prettyqt\widgets\style.py
get_layout_spacing(control_1: widgets.sizepolicy.ControlTypeStr, control_2: widgets.sizepolicy.ControlTypeStr, orientation: constants.OrientationStr, option_or_widget: QtCore.QWidgets.QStyleOption | QtWidgets.QWidget | None = None)
Source code in prettyqt\widgets\style.py
StyleOption
Bases: StyleOptionMixin, QtWidgets.QStyleOption
StyleOptionButton
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionButton
StyleOptionComboBox
StyleOptionComplex
Bases: StyleOptionComplexMixin, QtWidgets.QStyleOptionComplex
StyleOptionComplexMixin
Bases: widgets.StyleOptionMixin
StyleOptionDockWidget
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionDockWidget
StyleOptionFocusRect
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionFocusRect
StyleOptionFrame
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionFrame
StyleOptionGraphicsItem
StyleOptionGroupBox
Bases: widgets.StyleOptionComplex, QtWidgets.QStyleOptionGroupBox
StyleOptionHeader
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionHeader
StyleOptionMenuItem
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionMenuItem
StyleOptionMixin
Source code in prettyqt\widgets\styleoption.py
StyleOptionProgressBar
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionProgressBar
StyleOptionRubberBand
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionRubberBand
StyleOptionSizeGrip
StyleOptionSlider
Bases: widgets.StyleOptionComplexMixin, QtWidgets.QStyleOptionSlider
Source code in prettyqt\widgets\styleoptionslider.py
get_orientation() -> Literal['horizontal', 'vertical']
is_horizontal() -> bool
Check if silder is horizontal.
Returns:
| Type | Description |
|---|---|
bool
|
True if horizontal, else False |
is_vertical() -> bool
Check if silder is vertical.
Returns:
| Type | Description |
|---|---|
bool
|
True if vertical, else False |
set_horizontal() -> None
StyleOptionSpinBox
Bases: widgets.StyleOptionComplex, QtWidgets.QStyleOptionSpinBox
StyleOptionTab
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionTab
StyleOptionTabBarBase
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionTabBarBase
StyleOptionTabWidgetFrame
StyleOptionTitleBar
Bases: widgets.StyleOptionComplex, QtWidgets.QStyleOptionTitleBar
StyleOptionToolBar
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionToolBar
StyleOptionToolBox
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionToolBox
Source code in prettyqt\widgets\styleoptiontoolbox.py
get_selected_position() -> SelectedPositionStr
StyleOptionToolButton
Bases: widgets.StyleOptionComplex, QtWidgets.QStyleOptionToolButton
StyleOptionViewItem
Bases: widgets.StyleOptionMixin, QtWidgets.QStyleOptionViewItem
StylePainter
Bases: gui.PainterMixin, QtWidgets.QStylePainter
Source code in prettyqt\widgets\stylepainter.py
draw_complex_control(control: widgets.style.ComplexControlStr, option: QtWidgets.QStyleOptionComplex)
StyledItemDelegate
SwipeGesture
SystemTrayIcon
Bases: core.ObjectMixin, QtWidgets.QSystemTrayIcon
Source code in prettyqt\widgets\systemtrayicon.py
set_icon(icon: datatypes.IconType)
Set the system tray icon.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon |
datatypes.IconType
|
icon to use |
required |
show_message(title: str, message: str = '', icon: datatypes.IconType = None, timeout: int = 10)
Source code in prettyqt\widgets\systemtrayicon.py
TabBar
TabWidget
Bases: widgets.WidgetMixin, QtWidgets.QTabWidget
Widget for managing the tabs section.
Source code in prettyqt\widgets\tabwidget.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | |
detached_tabs: dict[str, DetachedTab] = {}
instance-attribute
tab_bar = widgets.TabBar(self)
instance-attribute
__contains__(item: QtWidgets.QWidget)
__getitem__(index: int) -> QtWidgets.QWidget
__init__(parent: QtWidgets.QWidget | None = None, closable: bool = False, detachable: bool = False) -> None
Source code in prettyqt\widgets\tabwidget.py
__len__() -> int
add_tab(item: QtWidgets.QWidget | QtWidgets.QLayout, label: str, icon: datatypes.IconType = None, position: int | None = None, show: bool = False) -> int
Source code in prettyqt\widgets\tabwidget.py
attach_tab(widget: QtWidgets.QWidget | QtWidgets.QLayout, name: str, icon: datatypes.IconType = None, insert_at: int | None = None)
Re-attach tab.
Re-attach the tab by removing the content from the DetachedTab window, closing it, and placing the content back into the DetachableTabWidget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
widget |
Union[QtWidgets.QWidget, QtWidgets.QLayout]
|
the content widget from the DetachedTab window |
required |
name |
str
|
the name of the detached tab |
required |
icon |
datatypes.IconType
|
the window icon for the detached tab |
None
|
insert_at |
Optional[int]
|
insert the re-attached tab at the given index |
None
|
Source code in prettyqt\widgets\tabwidget.py
close_detached_tabs()
detach_tab(index: int, point: datatypes.PointType)
Detach tab by removing its contents and placing them in a DetachedTab window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index |
int
|
index location of the tab to be detached |
required |
point |
QtCore.QPoint
|
screen pos for creating the new DetachedTab window |
required |
Source code in prettyqt\widgets\tabwidget.py
get_children() -> list[tuple]
get_tab_position() -> TabPositionStr
get_tab_shape() -> TabShapeStr
open_widget(widget: QtWidgets.QWidget, title: str = 'Unnamed')
Create a tab containing delivered widget.
remove_tab(index: int)
set_closable(closable: bool = True)
set_detachable()
set_document_mode(state: bool = True) -> None
set_icon_size(size: int | datatypes.SizeType)
Set size of the icons.
set_tab(index: int, position: str, widget: QtWidgets.QWidget | None = None)
set_tab_position(position: TabPositionStr)
Set tab position for the tabwidget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position |
TabPositionStr
|
tab position to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
tab position does not exist |
Source code in prettyqt\widgets\tabwidget.py
set_tab_shape(shape: TabShapeStr)
Set tab shape for the tabwidget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape |
TabShapeStr
|
tab shape to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
tab shape does not exist |
Source code in prettyqt\widgets\tabwidget.py
tab_icon(i: int) -> gui.Icon | None
update_tab_bar_visibility()
Update visibility of the tabBar depending of the number of tabs.
0 or 1 tab -> tabBar hidden, 2+ tabs - >tabBar visible need to be called explicitly, or be connected to tabInserted/tabRemoved
Source code in prettyqt\widgets\tabwidget.py
TableView
Bases: TableViewMixin, QtWidgets.QTableView
TableViewMixin
Bases: widgets.AbstractItemViewMixin
Source code in prettyqt\widgets\tableview.py
h_header
writable
property
v_header
writable
property
__init__(*args, **kwargs)
Source code in prettyqt\widgets\tableview.py
adapt_sizes()
get_grid_style() -> constants.PenStyleStr
set_grid_style(style: constants.PenStyleStr)
Set grid style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style |
constants.PenStyleStr
|
grid style to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid grid style |
Source code in prettyqt\widgets\tableview.py
setup_list_style()
sort_by_column(column: int | None, ascending: bool = True)
TableWidget
TableWidgetItem
Bases: QtWidgets.QTableWidgetItem
Source code in prettyqt\widgets\tablewidgetitem.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
__getitem__(index: int)
__setitem__(index: int, value)
get_background() -> gui.Brush
get_checkstate() -> constants.StateStr
get_font() -> gui.Font
get_foreground() -> gui.Brush
get_icon() -> gui.Icon | None
serialize_fields()
set_checkstate(state: constants.StateStr)
set_icon(icon: datatypes.IconType)
Set the icon for the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon |
datatypes.IconType
|
icon to use |
required |
set_text_alignment(horizontal: constants.HorizontalAlignmentStr | None = None, vertical: constants.VerticalAlignmentStr | None = None)
Set text alignment of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizontal |
constants.HorizontalAlignmentStr | None
|
horizontal text alignment to use |
None
|
vertical |
constants.VerticalAlignmentStr | None
|
vertical text alignment to use |
None
|
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid text alignment |
Source code in prettyqt\widgets\tablewidgetitem.py
set_tooltip(tooltip: str | datatypes.PathType, size: datatypes.SizeType | None = None)
Source code in prettyqt\widgets\tablewidgetitem.py
TableWidgetSelectionRange
Bases: QtWidgets.QTableWidgetSelectionRange
Source code in prettyqt\widgets\tablewidgetselectionrange.py
__and__(other: QtWidgets.QTableWidgetSelectionRange) -> TableWidgetSelectionRange
Source code in prettyqt\widgets\tablewidgetselectionrange.py
__eq__(other: object)
Source code in prettyqt\widgets\tablewidgetselectionrange.py
__or__(other: QtWidgets.QTableWidgetSelectionRange) -> TableWidgetSelectionRange
Source code in prettyqt\widgets\tablewidgetselectionrange.py
TapAndHoldGesture
Bases: widgets.GestureMixin, QtWidgets.QTapAndHoldGesture
Source code in prettyqt\widgets\tapandholdgesture.py
TapGesture
Bases: widgets.GestureMixin, QtWidgets.QTapGesture
Source code in prettyqt\widgets\tapgesture.py
TextBrowser
Bases: widgets.TextEditMixin, QtWidgets.QTextBrowser
Source code in prettyqt\widgets\textbrowser.py
value_changed = core.Signal(str)
class-attribute
__init__(*args, **kwargs)
get_search_paths() -> list[pathlib.Path]
set_markdown(source: str)
set_markdown_file(file_path: datatypes.PathType)
set_rst(source: str)
set_rst_file(file_path: datatypes.PathType)
TextEdit
Bases: TextEditMixin, QtWidgets.QTextEdit
TextEditMixin
Bases: widgets.AbstractScrollAreaMixin
Source code in prettyqt\widgets\textedit.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
value_changed = core.Signal(str)
class-attribute
__add__(other: str) -> TextEdit
__init__(*args, **kwargs) -> None
append_text(text: str) -> None
create_cursor() -> Iterator[gui.TextCursor]
get_auto_formatting() -> AutoFormattingStr
Get the current auto formatting mode.
Returns:
| Type | Description |
|---|---|
AutoFormattingStr
|
Auto formatting mode |
get_line_wrap_mode() -> LineWrapModeStr
get_text_cursor() -> gui.TextCursor
get_word_wrap_mode() -> gui.textoption.WordWrapModeStr
Get the current word wrap mode.
Returns:
| Type | Description |
|---|---|
gui.textoption.WordWrapModeStr
|
Word wrap mode |
on_value_change() -> None
select_text(start: int, end: int) -> None
set_auto_formatting(mode: AutoFormattingStr)
Set auto formatting mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
AutoFormattingStr
|
auto formatting mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
auto formatting mode does not exist |
Source code in prettyqt\widgets\textedit.py
set_line_wrap_mode(mode: LineWrapModeStr)
Set line wrap mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
LineWrapModeStr
|
line wrap mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
line wrap mode does not exist |
Source code in prettyqt\widgets\textedit.py
set_read_only(value: bool = True) -> None
set_text(text: str) -> None
set_text_color(color: datatypes.ColorType) -> None
set_word_wrap_mode(mode: gui.textoption.WordWrapModeStr)
Set word wrap mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
gui.textoption.WordWrapModeStr
|
word wrap mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
wrap mode does not exist |
Source code in prettyqt\widgets\textedit.py
TimeEdit
Bases: widgets.DateTimeEditMixin, QtWidgets.QTimeEdit
Source code in prettyqt\widgets\timeedit.py
value_changed = core.Signal(datetime.datetime)
class-attribute
get_value() -> datetime.time
set_range(lower: datatypes.TimeType, upper: datatypes.TimeType)
Source code in prettyqt\widgets\timeedit.py
ToolBar
ToolBox
Bases: widgets.FrameMixin, QtWidgets.QToolBox
Source code in prettyqt\widgets\toolbox.py
__contains__(item: QtWidgets.QWidget)
__delitem__(index: int)
__getitem__(index: int | str) -> QtWidgets.QWidget
__iter__() -> Iterator[QtWidgets.QWidget]
add_widget(widget: QtWidgets.QWidget, title: str | None = None, icon: datatypes.IconType = None)
Source code in prettyqt\widgets\toolbox.py
get_children() -> list[QtWidgets.QWidget]
ToolButton
Bases: widgets.AbstractButtonMixin, QtWidgets.QToolButton
Source code in prettyqt\widgets\toolbutton.py
__getitem__(item: str) -> QtWidgets.QAction
for_menu(menu: QtWidgets.QMenu, icon: datatypes.IconType = None)
classmethod
get_arrow_type() -> constants.ArrowTypeStr
get_popup_mode() -> PopupModeStr
get_style() -> constants.ToolButtonStyleStr
set_arrow_type(mode: constants.ArrowTypeStr)
Set the arrow type of the toolbutton.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
constants.ArrowTypeStr
|
arrow type to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid arrow type |
Source code in prettyqt\widgets\toolbutton.py
set_default_action(action)
set_popup_mode(mode: PopupModeStr)
Set the popup mode of the toolbutton.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode |
PopupModeStr
|
popup mode to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid popup mode |
Source code in prettyqt\widgets\toolbutton.py
set_style(style: constants.ToolButtonStyleStr)
Set the toolbutton style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style |
constants.ToolButtonStyleStr
|
style to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid style |
Source code in prettyqt\widgets\toolbutton.py
ToolTip
Bases: QtWidgets.QToolTip
Source code in prettyqt\widgets\tooltip.py
show_text(position: datatypes.PointType | None = None, text: str = '', linebreak_px: int = 400)
classmethod
Source code in prettyqt\widgets\tooltip.py
TreeView
Bases: TreeViewMixin, QtWidgets.QTreeView
TreeViewMixin
Bases: widgets.AbstractItemViewMixin
Source code in prettyqt\widgets\treeview.py
h_header
writable
property
__init__(*args, **kwargs)
Source code in prettyqt\widgets\treeview.py
adapt_sizes()
Source code in prettyqt\widgets\treeview.py
expand_all()
serialize_fields()
Source code in prettyqt\widgets\treeview.py
set_indentation(indentation: int)
setup_list_style()
sort_by_column(column: int | None, ascending: bool = True)
TreeWidget
TreeWidgetItem
Bases: serializemixin.SerializeMixin, QtWidgets.QTreeWidgetItem
Source code in prettyqt\widgets\treewidgetitem.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
__add__(other: QtWidgets.QTreeWidgetItem) -> TreeWidgetItem
__delitem__(index: int)
__getitem__(index: int) -> QtWidgets.QTreeWidgetItem
__iter__() -> Iterator[QtWidgets.QTreeWidgetItem]
__len__()
__repr__()
get_background(column: int = 0) -> gui.Brush
get_checkstate(column: int = 0) -> constants.StateStr
get_child_indicator_policy() -> ChildIndicatorPolicyStr
Return current child indicator policy.
Returns:
| Type | Description |
|---|---|
ChildIndicatorPolicyStr
|
child indicator policy |
get_font(column: int = 0) -> gui.Font
get_foreground(column: int = 0) -> gui.Brush
get_icon(column: int = 0) -> gui.Icon | None
serialize_fields()
Source code in prettyqt\widgets\treewidgetitem.py
set_checkstate(state: constants.StateStr, column: int = 0)
Set checkstate of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
constants.StateStr
|
checkstate to use |
required |
column |
int
|
column |
0
|
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
invalid checkstate |
Source code in prettyqt\widgets\treewidgetitem.py
set_child_indicator_policy(policy: ChildIndicatorPolicyStr)
Set the child indicator policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
ChildIndicatorPolicyStr
|
child indicator policy |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
policy does not exist |
Source code in prettyqt\widgets\treewidgetitem.py
set_icon(icon: datatypes.IconType, column: int = 0)
Set the icon for the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon |
datatypes.IconType
|
icon to use |
required |
column |
int
|
column |
0
|
set_size_hint(hint: datatypes.SizeType, column: int = 0)
TreeWidgetItemIterator
Bases: QtWidgets.QTreeWidgetItemIterator
Source code in prettyqt\widgets\treewidgetitemiterator.py
__init__(other: QtWidgets.QTreeWidget | QtWidgets.QTreeWidgetItem | QtWidgets.QTreeWidgetItemIterator, flags: QtWidgets.QTreeWidgetItemIterator.IteratorFlag | None = None, hidden: bool | None = None, selected: bool | None = None, selectable: bool | None = None, draggable: bool | None = None, droppable: bool | None = None, has_children: bool | None = None, checked: bool | None = None, enabled: bool | None = None, editable: bool | None = None, user_flag: bool = False)
Source code in prettyqt\widgets\treewidgetitemiterator.py
UndoView
Bases: widgets.ListViewMixin, QtWidgets.QUndoView
Source code in prettyqt\widgets\undoview.py
__getitem__(index: int) -> QtGui.QUndoCommand
set_clean_icon(icon: datatypes.IconType)
Set the icon for the clean button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon |
datatypes.IconType
|
icon to use |
required |
WhatsThis
Bases: QtWidgets.QWhatsThis
Source code in prettyqt\widgets\whatsthis.py
Widget
Bases: WidgetMixin, prettyprinter.PrettyPrinter, QtWidgets.QWidget
WidgetAction
Bases: widgets.ActionMixin, QtWidgets.QWidgetAction
Source code in prettyqt\widgets\widgetaction.py
WidgetItem
Bases: widgets.LayoutItemMixin, QtWidgets.QWidgetItem
WidgetMixin
Bases: core.ObjectMixin
Source code in prettyqt\widgets\widget.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | |
box: QtWidgets.QLayout
class-attribute
_(x: None, y: int | None)
__repr__() -> str
center(screen: int = 0) -> None
current_font() -> Iterator[gui.Font]
delete_children()
Delete all children of the specified QObject.
Source code in prettyqt\widgets\widget.py
edit_font() -> Iterator[gui.Font]
edit_palette() -> Iterator[gui.Palette]
edit_stylesheet() -> Iterator[qstylizer.style.StyleSheet]
font_metrics() -> gui.FontMetrics
get_background_role() -> gui.palette.RoleStr
get_context_menu_policy() -> constants.ContextPolicyStr
Return current contextmenu policy.
Returns:
| Type | Description |
|---|---|
constants.ContextPolicyStr
|
contextmenu policy |
get_contextmenu_policy() -> constants.ContextPolicyStr
Return current contextmenu policy.
Returns:
| Type | Description |
|---|---|
constants.ContextPolicyStr
|
contextmenu policy |
Source code in prettyqt\widgets\widget.py
get_cursor() -> gui.Cursor
get_focus_policy() -> constants.FocusPolicyStr
Return waay the widget accepts keyboard focus.
Returns:
| Name | Type | Description |
|---|---|---|
str |
constants.FocusPolicyStr
|
Focus policy |
get_font() -> gui.Font
get_font_info() -> gui.FontInfo
get_font_metrics() -> gui.FontMetrics
get_foreground_role() -> gui.palette.RoleStr
get_icon() -> gui.Icon | None
get_image() -> QtGui.QPixmap
Source code in prettyqt\widgets\widget.py
get_modality() -> constants.ModalityStr
Get the current modality modes as a string.
Returns:
| Type | Description |
|---|---|
constants.ModalityStr
|
modality mode |
get_palette() -> gui.Palette
get_screen() -> gui.Screen | None
get_size_policy() -> widgets.SizePolicy
get_stylesheet() -> qstylizer.style.StyleSheet
get_title() -> str
get_window_file_path() -> pathlib.Path | None
get_window_state() -> constants.WindowStateStr
grab_keyboard_events() -> Iterator[None]
grab_mouse_events(cursor_shape: constants.CursorShapeStr | None = None) -> Iterator[None]
Source code in prettyqt\widgets\widget.py
insertAction(position_or_action: int | QtWidgets.QAction, action: QtWidgets.QAction)
Extend insertAction to also allow int index.
Source code in prettyqt\widgets\widget.py
raise_dock() -> bool
raise_to_top()
Source code in prettyqt\widgets\widget.py
resize(*size) -> None
set_attribute(attribute: constants.WidgetAttributeStr, state: bool = True) -> None
Source code in prettyqt\widgets\widget.py
set_attributes(**kwargs: bool) -> None
Source code in prettyqt\widgets\widget.py
set_background_color(color: datatypes.ColorType) -> None
set_background_role(role: gui.palette.RoleStr)
set_context_menu_policy(policy: constants.ContextPolicyStr) -> None
Set contextmenu policy for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
constants.ContextPolicyStr
|
contextmenu policy to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
policy does not exist |
Source code in prettyqt\widgets\widget.py
set_contextmenu_policy(policy: constants.ContextPolicyStr) -> None
set_cursor(cursor: constants.CursorShapeStr | QtGui.QCursor) -> None
Source code in prettyqt\widgets\widget.py
set_custom_menu(method: Callable) -> None
set_disabled() -> None
set_enabled(enabled: bool = True) -> None
set_flags(minimize: bool | None = None, maximize: bool | None = None, close: bool | None = None, stay_on_top: bool | None = None, frameless: bool | None = None, window: bool | None = None, dialog: bool | None = None, tooltip: bool | None = None, tool: bool | None = None, customize: bool | None = None, window_title: bool | None = None) -> None
Source code in prettyqt\widgets\widget.py
set_focus_policy(policy: constants.FocusPolicyStr) -> None
Set the way the widget accepts keyboard focus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
str
|
Focus policy |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
Description |
Source code in prettyqt\widgets\widget.py
set_font(font_name: str | None = None, font_size: int | None = None, weight: int | None = None, italic: bool = False) -> gui.Font
Source code in prettyqt\widgets\widget.py
set_font_size(size: int) -> None
set_foreground_role(role: gui.palette.RoleStr)
set_icon(icon: datatypes.IconType) -> None
Set the window icon.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon |
datatypes.IconType
|
icon to use |
required |
set_layout(layout: LayoutStr | QtWidgets.QLayout | None, margin: int | None = None, spacing: int | None = None)
Source code in prettyqt\widgets\widget.py
set_margin(margin: int) -> None
set_mask(area: datatypes.RectType | QtGui.QRegion | None, typ: gui.region.RegionTypeStr = 'rectangle')
Source code in prettyqt\widgets\widget.py
set_max_height(height: int | None) -> None
set_max_size(size: QtCore.QSize | tuple[int | None, int | None]) -> None
Source code in prettyqt\widgets\widget.py
set_max_width(width: int | None) -> None
set_min_height(height: int | None) -> None
set_min_size(size: QtCore.QSize | tuple[int | None, int | None]) -> None
Source code in prettyqt\widgets\widget.py
set_min_width(width: int | None) -> None
set_modality(modality: constants.ModalityStr) -> None
Set modality for the dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modality |
constants.ModalityStr
|
modality for the main window |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
modality type does not exist |
Source code in prettyqt\widgets\widget.py
set_size_policy(horizontal: widgets.sizepolicy.SizePolicyStr | None = None, vertical: widgets.sizepolicy.SizePolicyStr | None = None) -> None
Set the sizes policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizontal |
widgets.sizepolicy.SizePolicyStr | None
|
horizontal size policy |
None
|
vertical |
widgets.sizepolicy.SizePolicyStr | None
|
vertical size policy |
None
|
Source code in prettyqt\widgets\widget.py
set_stylesheet(ss: None | str | qstylizer.style.StyleSheet | datatypes.PathType)
Source code in prettyqt\widgets\widget.py
set_title(title: str) -> None
set_tooltip(tooltip: str | datatypes.PathType, size: datatypes.SizeType | None = None)
Source code in prettyqt\widgets\widget.py
set_window_file_path(path: datatypes.PathType)
set_window_flags(*flags: constants.WindowFlagStr, append: bool = False)
Source code in prettyqt\widgets\widget.py
set_window_state(policy: constants.WindowStateStr) -> None
Set window state for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy |
constants.WindowStateStr
|
window state to use |
required |
Raises:
| Type | Description |
|---|---|
InvalidParamError
|
policy does not exist |